35
loading...
This website collects cookies to deliver better user experience
Route::get('/profile', function () {
//
})->middleware('auth');
Route::get('/', function () {
//
})->middleware(['first', 'second']);
$uri = $request->path();
if ($request->is('admin/*')) {
//
}
if ($request->routeIs('admin.*')) {
//
}
$url = $request->url();
$urlWithQueryString = $request->fullUrl();
$request->fullUrlWithQuery(['type' => 'phone']);
$method = $request->method();
if ($request->isMethod('post')) {
//
}
use App\Http\Middleware\EnsureTokenIsValid;
Route::get('/profile', function () {
//
})->middleware(EnsureTokenIsValid::class);
withoutMiddleware
methoduse App\Http\Middleware\EnsureTokenIsValid;
Route::middleware([EnsureTokenIsValid::class])->group(function () {
Route::get('/', function () {
//
});
Route::get('/profile', function () {
//
})->withoutMiddleware([EnsureTokenIsValid::class]);
});
// Retrives the user...
$user = User::findOrFail(1);
// Throws a 404 because the user doesn't exist...
User::findOrFail(99);
// Retrives all 3 users...
$users = User::findOrFail([1, 2, 3]);
// Throws because it is unable to find *all* of the users
User::findOrFail([1, 2, 3, 99]);
// Instead of
Integration::where('name', 'foo')->first()->active;
// You can use
Integration::where('name', 'foo')->value('active');
// or this to throw an exception if no records found
Integration::where('name', 'foo')->valueOrFail('active');
$userEmail = User::where('email', $request->email)->value('email'); // [email protected]
$maskedEmail = Str::mask($userEmail, '*', 4); // user***************
// If needed, you provide a negative number as the third argument to the mask method
// which will instruct the method to begin masking at the given distance from the end of the string
$maskedEmail = Str::mask($userEmail, '*', -16, 6); // use******domain.com
MAIL_MAILER=log
MAIL_LOG_CHANNEL=mail
'mail' => [
'driver' => 'single',
'path' => storage_path('logs/mails.log'),
'level' => env('LOG_LEVEL', 'debug'),
],