Query string parameters to Routes

Query string parameters to Routes

2024-05-14 وقت القراءه : أقل من دقيقة

إذا قمنا بتمرير باراميترز إضافيه للـ route في مصفوفة ، هذه المفاتيح => والقيم ، بشكل تلقائي سوف يتم إضافتها للرابط

Route::get('user/{id}/profile', function ($id) {
    //
})->name('profile');
 
$url = route('profile', ['id' => 1, 'photos' => 'yes']); // Result: /user/1/profile?photos=yes
إضافة تعليق
Loading...