43 lines
908 B
PHP
43 lines
908 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Providers;
|
||
|
|
||
|
use Blade;
|
||
|
use Illuminate\Support\ServiceProvider;
|
||
|
use Schema;
|
||
|
|
||
|
class AppServiceProvider extends ServiceProvider
|
||
|
{
|
||
|
/**
|
||
|
* Bootstrap any application services.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function boot()
|
||
|
{
|
||
|
// Laravel db fix
|
||
|
Schema::defaultStringLength(191);
|
||
|
|
||
|
// Add setting directive
|
||
|
Blade::directive('setting', function ($expression) {
|
||
|
return "<?php echo setting($expression); ?>";
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Register any application services.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function register()
|
||
|
{
|
||
|
if (env('APP_DEBUG')) {
|
||
|
$this->app->register(\Barryvdh\Debugbar\ServiceProvider::class);
|
||
|
}
|
||
|
|
||
|
if (env('APP_ENV') !== 'production') {
|
||
|
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
|
||
|
}
|
||
|
}
|
||
|
}
|