Laravel query idea
I'm a bit stuck writing something that should be pretty simple, so I need your help. I have one main table "posts", and two other related tables "categories" and "sectors". I'm making the filter route, and the logic should be…
I'm a bit stuck writing something that should be pretty simple, so I need your help. I have one main table "posts", and two other related tables "categories" and "sectors". I'm making the filter route, and the logic should be…
I have two methods in my controller. Method Number one public function search(Request $request) { $search_text = $_GET['search']; } This method is getting me the value entered in the search bar input via $search_text variable. My goal here is to…
I was wondering how to show the number of days, which is the difference of the start and end date. For example: Using Carbon's diffInDays() $diff = $start_date->diffInDays($end_date) Now, let's say that the difference of $start_date and $end_end is 30…
I have to develop a Laravel application based on Microsoft Sql Server, so I started configuring a Docker ambient with an Sql Server on Linux container. Actually I'm working on my windows 10 laptop where I installed Docker Desktop. Here…
I need help here please, I embed a YouTube video when a user watch the embed video for 30seconds I want the claim reward button to display then the rest action is left to livewire this is what I have…
BadMethodCallException: Method LaravelPassportGuardsTokenGuard::attempt does not exist. in file C:xampphtdocstestpassportapilaravel-backend-apivendorlaravelframeworksrcIlluminateMacroableTraitsMacroable.php on line 112 auth()->guard('api')->attempt($request->only(['email', 'password']))) This is supported passport or not, because this error shows at my end. How to solve this? config->auth.php `page` 'company' => [ 'driver' => 'session', 'provider'…
this is my code in my controller: public function getPublicPost($school_id){ $public_feeds = app(AllyFeedRepository::class)->query() ->whereHas('user_detail', function($q){ $q->whereNull('deleted_at'); }) ->with('user_detail:id,name,profile_photo_path,deleted_at','userInstance:id,user_id,role_id','userInstance.role:id,name','announcement:id,description,file_path,type,deleted_at') ->whereSchoolId($school_id) ->orWhere('school_id' ,'=', null) ->orderBy('created_at','DESC') ->paginate(15); return $public_feeds; } then I add ->whereDate('deadline_viewing', '>=', now()) in my query suddenly I can't fetch…
I am deploying a Laravel backend app that is being used as an API service for a frontend app, and a lot of breaking changes were made to the laest version of the app, is it possible to invalidate all…
I would like to receive a GET Request in HelloController and execute a scheduled process (HelloWorldCommand) based on the content of request, but I am having trouble understanding how to do this. PHP 8.2.7 Laravel Framework 10.25.0 In the following…
I have a table of flights. Each flight has a field to set the flight after. There will be a start/end of the chain eg. you cannot set the next flight to one that is already in the chain. I…