Questions tagged [laravel-route]

33 questions
1
vote
3 answers

Replacing object ID by object name on URL on Laravel route

I am trying to make my URL more SEO friendly on my Laravel application by replacing the ID number of a certain object by the name on the URL when going to that specific register show page. Anyone knows how? This is what I got so far and it displays,…
Luiz Wynne
  • 460
  • 3
  • 10
  • 28
1
vote
3 answers

how to call two functions by one route in laravel

I want to get 2 functions by 1 route to view I tried like this but not working Route::post('prospect', ['ProspectController@store' , 'course_controller@show_details']);
Jazim Max
  • 111
  • 1
  • 10
0
votes
0 answers

Slashes in Laravel Routes

I'm new to Laravel and was wondering what is the significance and meaning of using forward slashes in routes? For example: Route::get('/welcome', 'MyController@welcome'); I get the same result with: Route::get('welcome',…
GTS Joe
  • 3,612
  • 12
  • 52
  • 94
0
votes
2 answers

How to redirect from one blade view to another blade view, and pass dynamically generated variable to it?

In my view , let's call it View-A, I get an input from user in a prompt and assign it to a variable, and then I need to load in browser another view, say View B, while passing it that variable. Say, in my viewA.blade.php, I have taken user's input…
NXA
  • 440
  • 2
  • 10
0
votes
2 answers

Recover URL Parameter Laravel

My front sends parameters in the url and I would like to get them back to my laravel controller. My route (back) Route::get('publication/Mls/{status}/{typeTransac}', 'MlsController@getIndicatorMlsList'); The console shows me this on the front…
HCP
  • 43
  • 8
0
votes
2 answers

How can I insert database value in LARAVEL herf route name

How can I insert database value in Laravel href route name ? Is this possible? {{$adminbank->bank_name}}
0
votes
3 answers

Apps route redirecting the wrong URL

------Platform Laravel 7x. -------- I am stuck in a simple problem. I can't find the error. While I am updating a form, it redirects to a wrong URL which I don't want and data doesn't update. Form action url: method="POST" action="{{'city/update/'.…
0
votes
0 answers

laravel route with any character until next /

i have created a route in laravel $stagechapter="[1-8]-.*"; $stagestage="[0-9]-.*"; Route::get('/{lang}/{chapter?}/{stage?}', 'StageController@Listing')->where('lang', $langs)->where("chapter",$stagechapter)->where("stage",$stagestage); I want any…
Hamboy75
  • 938
  • 1
  • 11
  • 22
0
votes
2 answers

Laravel 6 Search Route Giving 404

I've tried a few things already but some reason on my Homestead install of Laravel 6.17 I have a single route of /search that is giving a 404. I expect it to redirect if the user doesn't enter anything into the search field. I did run the…
0
votes
3 answers

Pass array with laravel route

My Route Route::get('complete/{purchase_id}/{failed_purchases?}', 'Controller@success'); My Controller $failed_purchases = []; for($i=0 ; $i < 2; $i++){ $failed_purchases[] = [ 'reason' => "failed $i" ]; } return…
JIJOMON K.A
  • 1,290
  • 3
  • 12
  • 29
0
votes
2 answers

How to send variable from blade to controller without changing the url

In blade I have a list of books. I want to choose a specific book to show its information. And to do so I want to send with href the id of the book to my controller passing through route. For example i have
0
votes
2 answers

Is there a solution for Missing required parameters for [Route:....?

Could someone please help me with this error? I have been struggling for days now. Missing required parameters for [Route: helper.update] [URI: helper/{id}]. (View: D:\Training\LaravelProjects\helps\resources\views\helper\edit.blade.php) I have…
Hisham Hafeel
  • 121
  • 1
  • 8
0
votes
1 answer

Exclude conditional routes in Laravel

I'm building and application in Laravel and Vuejs where I'm having Laravel routes as below: Route::get('/admin/{view?}', 'HomeController@admin')->where('view', '(.*)')->name('admin'); Route::get('/{view?}', 'HomeController@home')->where('view',…
Nitish Kumar
  • 6,054
  • 21
  • 82
  • 148
0
votes
1 answer

laravel 6 when login go to previous url not working

I'm using Laravel framework my previous version of laravel is 5.8 and in my middleware login public function handle($request, Closure $next) { if(Auth::check()) { return $next($request); } else { …
Awar Pulldozer
  • 1,071
  • 6
  • 23
  • 40
0
votes
2 answers

Laravel: how to set string as optional in route?

in web.php I have: Route::get('car/id/{id}/color/{color?}', 'carController@getCar); But I want the whole part of /color/{color?} to be optional not just the color parameter /{color?}, would you please tell me how to do this?
mark820850
  • 123
  • 1
  • 11