Skip to content

Commit

Permalink
service provider
Browse files Browse the repository at this point in the history
  • Loading branch information
storyn26383 committed Jan 23, 2018
1 parent 956c7c3 commit 456bdf9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,12 @@
"classmap": [
"database"
]
},
"extra": {
"laravel": {
"providers": [
"Sasaya\\LaravelImageable\\LaravelImageableServiceProvider"
]
}
}
}
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions src/LaravelImageableServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Sasaya\LaravelImageable;

use Illuminate\Routing\Route;
use Sasaya\LaravelImageable\Image;
use Illuminate\Support\ServiceProvider;

class LaravelImageableServiceProvider extends ServiceProvider
{
/**
* Boot the services for the application
*/
public function boot()
{
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');

Route::get('images/{image}', function (Image $image) {
return $image->response();
})->name('images.show')->middleware('web');
}
}

0 comments on commit 456bdf9

Please sign in to comment.