adrema/app/Providers/AppServiceProvider.php

40 lines
753 B
PHP

<?php
namespace App\Providers;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
JsonResource::withoutWrapping();
\Inertia::share('search', request()->query('search', ''));
RedirectResponse::macro('success', function($flash) {
session()->flash('flash', ['success' => $flash]);
return $this;
});
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
}