jeudi 2 février 2017

Laravel 5 set route conditionally

Hi I want to get specific route only based on the condition. I currently tried Session but it doesn't work with routes. So anyone here might want to help if there's simpe way to this.

if(\Session::get('quiz_type') == 'quiz'){
    Route::resource('quizzes.questions', 'QuestionsController');
}else{
    Route::resource('surveys.questions', 'QuestionsController');
}

I want that certain route Quiz only if I passed and meet a certain condtion. Else I want to call on different route.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2jGXexm
via IFTTT

Aucun commentaire:

Enregistrer un commentaire