Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sanjivsharma's avatar

Laravel Syntax of Where clause

I am relatively new to php and laravel, can someone please explain the meaning of the following code snippet(taken from web.php):

Route::get('{slug}', function() {
    return view('index');
})
->where('slug', '(?!api)([A-z\d-\/_.]+)?');
 
Auth::routes();
0 likes
1 reply

Please or to participate in this conversation.