I want to select all Users which are not members of a Group with id=6 – Laravel
My tables users id name Cell 1 Cell 2 Cell 3 Cell 4 group id name Cell 1 Cell 2 Cell 3 Cell 4 group_users id user_id group_id Cell 1 Cell 2 Cell 4 Cell 3 Cell 4 Cell 6…
My tables users id name Cell 1 Cell 2 Cell 3 Cell 4 group id name Cell 1 Cell 2 Cell 3 Cell 4 group_users id user_id group_id Cell 1 Cell 2 Cell 4 Cell 3 Cell 4 Cell 6…
I'm doing a dental function, I'm looking to sync data in a many-to-many relationship. I have the following: tooth - id - name cost - id - name cost_tooth - id - tooth_id - cost_id - row_number This is the…
how can I increase the laravel 8 dd() limitations? I have lots of nested relationship and I cant view most of them due to many data. For example this #relations: array:4 [▼ "activecourses" => IlluminateDatabaseEloquentCollection {#1346 ▼ #items: array:3 [▼…
I'm using Laravel 9 for making a forum project. Now for this project, I need to upload some images. So at the Controller, I added this: if($request->has('filep')){ $files = $request->file('filep'); foreach ($files as $file) { $this->uploadImage($file, $questionCreated->id, 'question_image'); } }…
I'm truing to get the employees that have birthday within next 3 days. I tried to do that by using the following query. public function upcomingBirthdays() { $from = now()->format('m-d'); $to = now()->addDays(3)->format('m-d'); $employees = Employees::whereRaw("DATE_FORMAT(dob, '%m-%d') BETWEEN '{$from}' AND…
Here is a Rest Api method that sets the user rating. The database table contains the composite primary key: user_id + rate_id. When user tries to set the same rating the framework throws an exception. I catch it and return…
I have a button on my blade that calls a select method, this method emitted an event but it is not arriving Button blade: <div class="ml-auto"> <button class="br-button secondary circle" type="button" aria-label="Selecionar" wire:click="selecionar({{ json_encode($user) }})"> <i class="fas fa-arrow-right"></i> </button> </div>…
I have this mechanism of checking the logged-in user role in a blade page so that I can give him/ her the selected pages but I find after a user has logged in and stayed idle for a long time…
I'am very confused to get someone's birthday date by changing Y-m-d to m-d in the date_birth field. How should I do? This is my current code: $getBirthday = Karyawan::where('date_birth', Carbon::now()->format('m-d'))->get(); Thanks, I want to get someone's birthday by taking m-d…
public function doctorToday(Request $request){ $doctors = Appointment::with('doctor')->whereDate('date',date('Y-m-d'))->get(); return $doctors; May I know how to implement one more day to the code? I want to get the tommorow's date instead of today's.