diff --git a/app/Helpers/functions.php b/app/Helpers/functions.php new file mode 100644 index 0000000..805405b --- /dev/null +++ b/app/Helpers/functions.php @@ -0,0 +1,21 @@ +flash('flash_notification.message', $message); + $session->flash('flash_notification.level', $level); + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ee8ca5b..c764339 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -23,6 +23,6 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // + require_once app_path().'/Helpers/functions.php'; } } diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 1f34466..c5b0647 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -15,6 +15,8 @@ @endif {{ __('You are logged in!') }} +
+ Run a long job diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 7bcfd31..f34469e 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -9,9 +9,6 @@ {{ config('app.name', 'Laravel') }} - - - @@ -76,5 +73,29 @@ @yield('content') + + + + + @if (Session::has('flash_notification.message')) + + @endif diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 7390745..3fb48cc 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -97,28 +97,4 @@ - - - - - @if (Session::has('flash_notification.message')) - - @endif diff --git a/routes/web.php b/routes/web.php index be84b3f..9f8bf0c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -15,10 +15,16 @@ use Illuminate\Support\Facades\Route; */ Route::get('/', function () { - dispatch(new LongRunJob()); return view('welcome'); }); +Route::get('/long-run-job', function () { + dispatch(new LongRunJob()); + + flash('Please wait, your request is processing...'); + return redirect()->home(); +})->name('long-run-job'); + Auth::routes(); Route::get('/home', 'HomeController@index')->name('home');