Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
103 views

I have a simple form where users come to report who they helped, and how. It is anonymous in the fact that they do not have to login in, but they are asked to provide their name. They will make many ...
wruckie's user avatar
  • 1,821
1 vote
0 answers
57 views

Getting this when redirected from the controller or middleware, just cloned this project from the live server to the local machine. have also tried this php artisan serve but still facing the same ...
Osama Zubair's user avatar
1 vote
2 answers
99 views

I have made a middleware for admin routes public function handle(Request $request, Closure $next) { if (!auth()->check() || !auth()->user()->is_admin) { abort(401); } ...
Mohsen's user avatar
  • 302
0 votes
0 answers
83 views

We are using Laravel and trying to update the Cors.php middleware, but it's not working. Here is the Cors.php code public function handle($request, Closure $next) { if (null !== $...
Sohang Tyagi's user avatar
0 votes
1 answer
89 views

I installed Log Viewer in my laravel 11 protect, and works like a charm. But i want to limit who has access to the Log Viewer in production. So,i create a middleware <?php namespace App\Http\...
Zekura's user avatar
  • 335
3 votes
1 answer
119 views

I have a redirect middleware. This middleware checks if the path is defined in our Redirection module table. Normally, when a page exists (200) say http://localhost/existing-page, I can redirect the ...
Exarillion's user avatar
0 votes
1 answer
96 views

So basically I work on a Laravel 11 project, and the session cookie is generated by a portal from which I access my application. I have an AuthMiddleware aliased to 'sso' which is responsible for ...
naspy971's user avatar
  • 1,411
2 votes
2 answers
333 views

<?php namespace App\Providers; use Illuminate\Cache\RateLimiting\Limit; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Http\Request; use ...
Hemil's user avatar
  • 29
0 votes
1 answer
42 views

I'm starting a SaaS and to avoid having a too big database, and to help for debugging, I would like each user to use its own database, without duplicating the laravel app. I have been suggesting using ...
Jean François Manatane's user avatar
0 votes
1 answer
1k views

i am developing REST API laravel 11 app i installed spatie/laravel-permission and i can create a user and assign role successfully also on login i can capture token and role successfully but when i to ...
Silikazi's user avatar
  • 495
1 vote
1 answer
79 views

This is how I do it: $ip = $request->ip(); if (Cache::has('banned_ip_' . $ip)) { return response()->json([ 'message' => 'Access blocked', 'reason' => 'You have been ...
Peiman's user avatar
  • 11
1 vote
1 answer
81 views

I'm trying to add a new middleware to a group of routes that I got in my routes/web.php Route::group(['middleware'=>['xFrameOptionsHeader','VerifyHeaders']], function(){ Route::get('/', '...
Fnr's user avatar
  • 2,304
1 vote
0 answers
74 views

Basically I'm building a pet adoption site and now getting an error which says "Target class [admin] does not exist" when my admin user account is trying to approve 'adoption request' of any ...
Zabia Hossain's user avatar
1 vote
1 answer
84 views

Laravel Project I have created a custom Postman header called company_code, and it works on my local development environment on my PC. However, when I deploy this project on a live server, the custom ...
Mahesh's user avatar
  • 11
0 votes
1 answer
194 views

We have this middleware in my app because internal security asked us to overwrite these response headers. class NoCacheControlHeaders { public function handle(Request $request, Closure $next) {...
Nebster's user avatar
  • 914
2 votes
1 answer
137 views

I created a laravel middleware with this code: <?php namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; use Symfony\Component\HttpFoundation\Response; use App\Containers\...
Hilal Najem's user avatar
1 vote
1 answer
90 views

I want to create middleware where when I want to access a website page I have to do a second login first, and if I don't have a token then the page will redirect to the login page. I entered the code ...
sing tenang's user avatar
0 votes
0 answers
273 views

In Laravel, I can sign up and log in without any issues using Breeze. In my table, I have: $table->enum('role', ['admin', 'user']); Here’s how your bootstrap/app.php file looks: <?php use App\...
Serdar Kavrazlı's user avatar
1 vote
1 answer
662 views

In my Controller that extends the Illuminate\Routing\Controller, i am trying to implement some middlware validations using the new HasMiddleware. This is the code that i am trying to run: <?php ...
acaro_man's user avatar
1 vote
2 answers
2k views

I have a api project with Laravel 11, and i want to make a middleware for admin api. AdminMiddleware.php (custom middleware) <?php namespace App\Http\Middleware; use Closure; use Illuminate\Http\...
Fieza Ghifari's user avatar
0 votes
1 answer
721 views

im trying to authenticate a request sent from the front end from another domain i tried to set the 'Cookie' header with the cookie value but it was blocked by the browser ,so i did the following ...
naoru's user avatar
  • 2,247
1 vote
1 answer
260 views

I am writing a rate limits middleware in which i have to do a folowing functionality 1:Sending first is instant the second request will ask you to wait 30 seconds, third will ask to wait 60 seconds, ...
Mimi's user avatar
  • 43
1 vote
1 answer
576 views

In my Laravel Project i have few routes which i want to protect if the user is not authenticated thats why i make this changes to Authenticate middleware : namespace App\Http\Middleware; use ...
Shubham Kandalgaonkar's user avatar
0 votes
1 answer
120 views

I am working on a Laravel 10 application with middleware that checks if a token has expired. If it has, it generates a new token using refresh_token, creates a new session, and updates the session ...
José Victor's user avatar
-2 votes
1 answer
113 views

I have a storage url that can be opened and it looks like this <a href="{{ Storage::url('invoices/'. $invoice->invoice_number . '.pdf') }}?is_opened={{ $token }}" class="f-...
Timofey A Bogdanov's user avatar
17 votes
4 answers
22k views

I have a route that serves as a webhook endpoint that gets called by a remote service, but the calls that the service makes to the webhook always fail. After some inspection of the service logs, I ...
Eyad Bereh's user avatar
  • 1,878
1 vote
0 answers
1k views

I'm facing a CORS policy issue in my Laravel application when trying to make a request to an API endpoint from my frontend. The error message I'm receiving is: Access to XMLHttpRequest at 'https://...
Hocine Djouamaa's user avatar
0 votes
1 answer
541 views

Through Laravel 10, I was able to check if the ConvertEmptyStringsToNull middleware was globally registered by using the following code: $kernel = $this->getLaravel()->make('App\\Http\\Kernel'); ...
Jay's user avatar
  • 2,422
0 votes
1 answer
494 views

I tried using guards for admins but its not working in Middleware in Laravel 11. I have connected the MongoDB with Laravel 11 for managing its database. My admin login function looks like below where ...
Amit Gupta's user avatar
  • 2,816
2 votes
0 answers
149 views

I have a Laravel 8 website in which users fill in a form and click a link to take them to an external payment website. Once the user has paid (or canceled payment), the payment website redirects the ...
LabRetriever's user avatar
-3 votes
1 answer
4k views

I'm building an admin section for a Laravel 10 app using the boilerplate Breeze routes and templates (for now) and I have a group of prefixed routes that I want to return a 404 error for in the ...
justpete's user avatar
2 votes
2 answers
892 views

I want to implement a user tracking system, after searching I realized that I have to do this in the middleware. The problem I had was that I could only add values to the response header in the ...
Francisco Martinez's user avatar
0 votes
2 answers
77 views

I'm a beginner with Laravel and inertia. I use Laravel 10 with Inertia and react. When I go to the index page, the field "$this->typeEducation->title" is filled, but when I click edit, ...
ontwikkelaar15's user avatar
-1 votes
1 answer
106 views

in my Laravel project These two queries are executing everywhere regarding my route's middleware I need to skip them for some routes how can I do that I have tried creating "withoutThrottle" ...
arlabbafi's user avatar
1 vote
1 answer
80 views

Edit: Ali Ismaeel provided a great answer to my structure, but I had done a poor job of asking the question and re-wrote it. My edit history shows what he was addressing. Sorry, I'm trying to get ...
Aerdan's user avatar
  • 51
0 votes
1 answer
574 views

How to fix Target class [Spatie\Permission\Middleware\PermissionMiddleware] does not exist. I hope the code can run smoothly again, please help me, I've tried changing the code but it still doesn't ...
Maulana Ikhsan 2's user avatar
-1 votes
1 answer
485 views

The error I face is Illuminate\Contracts\Container\BindingResolutionException Target class [admin] does not exist. (Laravel Version 7.30.6) My Routes are given below : //admin routes Route::group(['...
Muhammad Manik Uddin's user avatar
0 votes
2 answers
57 views

public function __construct() { if (Auth::check()){ if(Auth::user()->user_type == 'admin'){ return to_route('admin.dashboard'); } elseif(Auth::user()->user_type =...
user20886427's user avatar
0 votes
0 answers
185 views

I'm upgrading an old Laravel app to Laravel 8. Everything went fine with the upgrade except for being able to connect through the API. When I do try, I get a crash message Class 'Symfony\Bridge\...
Califer's user avatar
  • 526
0 votes
1 answer
1k views

I'm currently developing an API using Laravel 7.30.6 and I'd like to be able to handle all errors and return a Internal server error with HTTP code 500 on all the API routes if anything goes wrong, ...
Arkaik's user avatar
  • 924
0 votes
1 answer
353 views

I've been trying to deploy a Laravel / Inertia app, using digitalOcean app Platform. In dev environment everythings goes well. In production, the middleware, auth and a custum one I made, works only ...
Velwitch's user avatar
1 vote
1 answer
214 views

I have set up a project and written some routes in the api.php route file. I created a middleware, registered the middleware in the Kernel.php file, and then implemented the middleware in the api.php ...
Rizwan Saleem's user avatar
0 votes
1 answer
737 views

I'm trying to prevent some users from accessing to some routes. I have created a middleware called CheckUserRole. But I always get a null response when I try to fetch any data from the logged-in user, ...
Alejandro V.'s user avatar
0 votes
1 answer
45 views

I am working with Laravel version 8, and I want to use the global scope to add a where clause to all queries of the User model. /** * The "booting" method of the model. * @return void */ ...
zarin's user avatar
  • 7
0 votes
1 answer
146 views

I'm buiding a user management system. The current routes on web.php are here: Route::middleware(['admin']) ->prefix('users') ->name('users.') ->group(function() { Route::...
alexandre9865's user avatar
0 votes
1 answer
107 views

In laravel have added socialite login for google,but i wanted them to be authenticated first before going to /studentTable route. And if they are not authenticated then they go back to login. Im new ...
Sard's user avatar
  • 91
2 votes
0 answers
190 views

I want to verify bearer token for GUEST users in LARAVEL API so how can I generate user access token for guest users and also verify in AUTH:API middleware
Rajdipsinhji Hada's user avatar
0 votes
2 answers
984 views

I am trying to use JWT for API authentication I am building, I have managed to get the JWT token with code like the following: $user = User::select('id_user', DB::raw('AES_DECRYPT(id_user, "nur&...
HALIM's user avatar
  • 75
1 vote
2 answers
2k views

I want to make a middleware in my Laravel 9 project where if the user is inactive, they automatically get logged out. In my middleware class, like the following. public function handle(Request $...
Mifta Khussolikhin's user avatar
0 votes
1 answer
93 views

I am trying to allow a user (these would only be admin) to redirect one URL to another URL (I own all of these URLs so I am able to redirect them). I am currently passing the URLs they enter from the ...
Daniel Bailey's user avatar

1
2 3 4 5
12