Laravel-[routing]

eighteen sfzh

php code
Route::get('/sfz/{id?}',function($id){
    
    
    dd($id);
 })->where('id','[0-9]{17}[0-9|x]+');
 
run

insert image description here

sfzh ending in x

insert image description here
Homework: Design routing rules, when the following address is entered in the browser address bar, it can be executed correctly.

.../admin/user/33

...Indicates the domain name.

 Route::get('/admin/{user}/33',function($id){
    
    
     dd(route('user',$id));
 })->name('user');

insert image description here

Guess you like

Origin blog.csdn.net/lj1641719803hh/article/details/123465113