call route in laravel blade if exists only - development

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

Comments

Popular posts from this blog

ng-include of inline SVG does not display gradient except in Chrome

Using PHP and MySQL data to generate PDF letters like in MS Word mailmerge functionality - development

ng-show doesn’t work correct with value boolean