Skip to content

Instantly share code, notes, and snippets.

@scmrus
Last active November 14, 2019 15:01
Show Gist options
  • Save scmrus/0bf08c003bd24dbdb61217445a8d70b2 to your computer and use it in GitHub Desktop.
Save scmrus/0bf08c003bd24dbdb61217445a8d70b2 to your computer and use it in GitHub Desktop.
laravel54
<?php
// sql debug using tinker
DB::listen(function($sql){var_dump($sql->sql, $sql->bindings, $sql->time);});
// sql debug using log
DB::enableQueryLog();
dd(DB::getQueryLog());
// hashes
Hash::make('123');
//dev route to auth quickly
Route::get('/login-as', function(Request $request){
// Auth::logout();
if ($user = \App\Models\Profile::find($request->id)) {
Auth::login($user, true);
return redirect('/');
}
$list = [5,3];
\App\Models\Profile::whereIn('id', $list)->orderBy('id')->each(function($user){
echo '<pre style="text-align:center; font-size:32px;"><a href="?id='.$user->id.'" style="display:block;">'.$user->full_name.' ('.$user->email.')</a></pre>';
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment