45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace Meoran\Images\Providers;
|
||
|
|
||
|
use Illuminate\Support\ServiceProvider;
|
||
|
use Intervention\Image\ImageServiceProvider;
|
||
|
use Spatie\LaravelImageOptimizer\ImageOptimizerServiceProvider;
|
||
|
|
||
|
class ImagesServiceProvider extends ServiceProvider
|
||
|
{
|
||
|
|
||
|
public function boot()
|
||
|
{
|
||
|
require_once __DIR__ . '/../functions.php';
|
||
|
|
||
|
$this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
|
||
|
|
||
|
$this->mergeConfigFrom(__DIR__ . '/../../config/image.php', 'image');
|
||
|
|
||
|
|
||
|
$this->app->register(ImageServiceProvider::class);
|
||
|
$this->app->register(ImageOptimizerServiceProvider::class);
|
||
|
|
||
|
$this->loadRoutes();
|
||
|
|
||
|
if ($this->app->runningInConsole()) {
|
||
|
$this->publishes([
|
||
|
// __DIR__ . '/../../config/synchronize.php' => base_path('config/synchronize.php')
|
||
|
]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public function loadRoutes()
|
||
|
{
|
||
|
$this->app->get('images/upload', [
|
||
|
'as' => 'uploadImage', 'uses' => '\Meoran\Images\Http\Controllers\ImagesController@upload'
|
||
|
]);
|
||
|
|
||
|
$this->app->get('images/{template}/{filename}', [
|
||
|
'as' => 'getPicture', 'uses' => '\Meoran\Images\Http\Controllers\ImagesController@get'
|
||
|
]);
|
||
|
}
|
||
|
|
||
|
}
|