Last active
November 14, 2019 15:01
-
-
Save scmrus/0bf08c003bd24dbdb61217445a8d70b2 to your computer and use it in GitHub Desktop.
laravel54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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