Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • You don't have to check if the request is ajax if($request->ajax()) unless you want to use that action function for other calls, but better to use separate methods for ajax calls and other types that is a good practice. Also strongly recommend reading official laravel documentation, everything there explained and have many routing, validation, eloquent etc. examples Commented Aug 28, 2020 at 5:47
  • Also note that in script tags you can use php(laravel) variable only in quotes '{{ $packageSlug }}' Commented Aug 28, 2020 at 5:55