Skip to content
Advertisement

Tag: laravel-routing

Laravel URL Filtering with GET

I am building a simple Laravel routing to display an array when someone goes to http://127.0.0.1:8000/planets But I need to make a filter to check the array on what request has been send on the URL. For example: http://127.0.0.1:8000/planets?planet=mars I need to make sure that if a GET parameter is present, you filter the array based on whether the planet

Laravel model user custom binding “/users/me/xxx”

I have routes with user binding like So I can use /users/1/posts, /users/5/posts etc, and in controller it’s automatically available thanks to model binding But for current logged user I want to make possible to also use /me/ instead ID, like /users/me/posts Is there a way to make it without defining separate controller methods where I would have to find

routes/web route me to another route

My web doesn’t seem to be directing to the correct page. Here is my blade Here is my routes/web and here is my controller For some reason, when I click the a tag with the href {{ route(‘add-new-information’) }} to go to the add page ‘adminviews/addinfo’, instead the page will go to the ‘adminviews/infoadmin’ page, which will cause an error,

Laravel 8 redirect web routes

It seems there is an error in my Laravel 8 routes somewhere. My web routes file: When going to /, it is redirected to /en. But when going to /dashboard it isn’t redirected to /dashboard/en but gives an error: As can be seen, not a lot of information given. Anyone knows what to do? Answer Found it: Laravel handles routes

Ways to write Laravel routes

Is there a better way to write these routes? It seems I am repeating the same controller in my route files. Answer You can use a resource route, where you specify a subset of actions in the controller. You can also use the –model option when generating a controller with the stubbed out CRUD methods. Result:

Laravel: Passing data into route from database

I have created a theme system and I am trying to make the theme’s route file pull pages from the database and assign a route to it, below is my theme route file. The issue I am having is an Undefined variable: theme from my ThemeSettings::all model request. Route.php (In theme) ThemeSettings Migration These settings have worked in other parts

Advertisement