call route in laravel blade if exists only
I have an ajax function which will use an URL.
ajaxMyFunction('', function (result) { //do stuff });
I want to call the route only if it exists in my dynamic route list because Laravel throws exception if myroute.route1
doesn’t exist yet.
Is there a way to check route before render it inside blade, like when we check views ?
@if(View::exists('myroute.route1'))
I tried, Route::has('myroute.route1')
but it doesn’t work as well.
Thanx for your help guys
from Laravel Questions and Answers https://laravelquestions.com/laravel/call-route-in-laravel-blade-if-exists-only/
via Lzo Media
No comments:
Post a Comment