Category : redirect

I have the home page in web.php the login page: Route::get(‘/’, function () { return view(‘auth.login’); }); And when the user logs in the authenticated page: Route::middleware([‘auth:sanctum’, ‘verified’])->get(‘/admin’, function () { return view(‘admin.index’); })->name(‘panel’); The problem is that if I manually type in the url of the browser, the main page appears the login page ..

Read more

I have the home page in web.php the login page: Route::get(‘/’, function () { return view(‘auth.login’); }); And when the user logs in the authenticated page: Route::middleware([‘auth:sanctum’, ‘verified’])->get(‘/admin’, function () { return view(‘admin.index’); })->name(‘panel’); The problem is that if I manually type in the url of the browser, the main page appears the login page ..

Read more

I have page that i reach it from post route : Route::post(‘/daily’, [AppHttpControllersAdminController::class, ‘daily’])->name(‘daily’); in this page i have icon which have action of update data by get method : <td class="text-center notforprint"> <a href="{{route(‘abs_action’,["id"=>$item->id,"action"=>’edit’,’date’=>$absences[0]->date,’stage’=>$stage,’group’=>$absences[0]->group])}}"><i class="fas fa-check-circle"></i></a></td> in ‘abs_action’ controller I update data and want return back to same page with array that the page ..

Read more

So for example we have url: localhost://menu/men/shoes/nike So when user types this url in browser i want to redirect him to page localhost://menu/SOMETHINGELSE/shoes/nike localhost://menu/men/clothes/addidas => localhost://menu/SOMETHINGELSE/clothes/addidas How can i do this in Laravel? Sourc..

Read more

I am trying to redirect the Vue.js application with Laravel’s redirect() method but seemingly it doesn’t work with Vue.js. Currently I am returning a redirect in one of my controllers in this way: return redirect(url); The redirection works when I call the endpoint from Chrome, but it doesn’t work when the endpoint is called from ..

Read more

I am trying to replicate tinyurl functionality. Here is the flow of the application: URL Route: abc.com/{id} – there is a URL in the database against the ID. Route::get(‘/{id}’, [AppHttpControllersController::class, ‘direct’]); Controller: Receiving the route request, following actions are being performed in the controller: public function direct($id) { $link = Link::where(DB::raw(‘BINARY `slug`’),’=’,$id)->where(‘status’,’=’,1)->firstOrFail(); $url = $link->url; ..

Read more

Older version of laravel here, 5.7. I have a situation where I have a url like this http://127.0.0.1:8000// I have a catch all of this Route::get(‘{uri}’, [‘uses’=>’[email protected]’])->where(‘uri’, ‘(.*)’); The URL that comes into the render method is ”. I’m not quite sure the best way to take http://127.0.0.1:8000// and redirect that to http://127.0.0.1:8000. .htaccess doesn’t ..

Read more

I have encountered a lot of this error. but I can’t understand why that doesn’t work?? Here is the scenario: I want to make a middleware to prevent authenticated users from viewing the login and register form. So, I already wrote the MustNotBeLoggedIn.php: <?php namespace AppHttpMiddlewareAuthenticateUsers; use Closure; use IlluminateHttpRequest; use IlluminateSupportFacadesAuth; class MustNotBeLoggedIn { ..

Read more

I hope everyone can help me with my Laravel project, I am using Laravel 8 and after a user successfully created an account, user should be routed to http://127.0.0.1:8000/register/plan However, I’m getting below error, appreciate your expert advise in advance. CODE <?php namespace AppHttpMiddleware; use Closure; use IlluminateSupportFacadesAuth; use AppModelsLeagueMember; class CheckRegistration { protected $except ..

Read more

im trying to redirect my delete function back to index page that have parameter team. but it keeps throwing me Error Exception array to string conversion. here my index fucntion on MonitorController.php public function index(Team $team) { $team = Team::where(‘id’,$team->id)->first(); $objective = Objective::with(‘keyresult’) ->where(‘team_id’,$team->id) ->get(); $objective = Objective::with(‘task’) ->where(‘team_id’,$team->id) ->get(); $objective = Objective::with(‘deadline’) ->where(‘team_id’,$team->id) ->get(); ..

Read more