Php – Laravel 10 – Make a Limit in ThrottleRequest with cache
So I want to give a limit to requests that require a key, and a limit of 100x requests in 60 minutes (for a trial of 10x requests in 5 seconds) and will return (reset) to 0. but i tried…
So I want to give a limit to requests that require a key, and a limit of 100x requests in 60 minutes (for a trial of 10x requests in 5 seconds) and will return (reset) to 0. but i tried…
I'm trying to populate a HTML select dropdown with values of a particular column in the database which is an array in this format ["Red","Yellow","Blue"]. I know how to pull the entire product instance for a particular row from DB…
I have a problem with my laravel 8 project, everything in the foreach column raises an error when I test the order, but when I don't order, the error doesn't show up. Controller public function index(Request $request) { $bookings =…
I'm struggling to get Laravel Sail working. Following the instructions from the documentation I'm not really understanding why the container is failing to build. I don't have any docker experience. ./vendor/bin/sail php -v returns "Cannot load Xdebug - it was…
I have a route of feedback which is accessible to both users and chancellors prefixes, but the issue is that I want to write it once in web.php, now I have to write it multiple times in users and chancellors…
I wrote a code that sums the number of minutes of several videos together. But it shows the following error: Attempt to read property "episodes" on null public function setCourseTime($episode) { $course = $episode->course; $course->time = $this->getCourseTime($course->episodes->pluck('time')); $course->save(); } Model…
I'm working with Laravel 8... So I have the following eloquent query, I've eager loaded a bunch of models but I want to do 2 things to the way the models are loaded: Only select certain fields from the cooking_methods…
Here is my validation code in the controller $eldate = Carbon::now()->addDay(4)->format('Y-m-d'); $validatedData = $this->validate($request, [ 'ldate' => 'required|date|unique:leaves,ldate,NULL,employee,employee,'.auth()->id(), 'ldate2' => 'nullable|date|after_or_equal:ldate', 'type' => 'required' ]); In this validation code I have to add one more condition for date1 If type…
I am a beginner and trying to save a small form in the database. Once I hit the submit button on the form, the error comes: "Target class [UserController] does not exist" I have already crawled online resources, got my…
I am trying to do an uptime check of my Laravel application. Essentially, I want to be able to login, and check that the home pages has loaded successfully via curl or similar. I am using the below curl command:…