Skip to content

Instantly share code, notes, and snippets.

@lukevers
Created October 31, 2017 13:15
Show Gist options
  • Save lukevers/16e3f81109bd30811d37d2b363e67e78 to your computer and use it in GitHub Desktop.
Save lukevers/16e3f81109bd30811d37d2b363e67e78 to your computer and use it in GitHub Desktop.
<?php
public function handle($request, Closure $next)
{
if (
Auth::check()
&& empty(Auth::user()->onboarded_at)
&& ! $request->is('welcome')
&& ! $request->is('i/*')
&& ! $request->is('logout')
) {
$user = Auth::user();
$user->onboarded_at = \Carbon\Carbon::now();
$user->save();
return redirect('/welcome');
}
return $next($request);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment