Category "laravel"

Eloquent Where using CASE WHEN and withMin()

I have a query like this: Product::withMin('promotions as promotion_price', 'promotion_products.price') ->orderByRaw('CASE WHEN promotion_price IS NULL THE

How to use Oauth2 Provider instead of Oauth1 in Laravel Socialite?

I'm currently developing social listening API with twitter, the flow is logged in user (using basic API Token to send request to the API) are redirected to twit

How can I display an html text as a function in the blade?

I want to display the text in the blade as html. To do this, I used this code in the controller section: ‌ class MessageController{ public function cus

Sending custom verification emails from a controller method

I have some data i am receiving from new users and extracting the email to send to the new user. This is how i am doing it public function register_mechanic_pos

What causes the "route not defined" error in this Laravel 8 API?

I am working on a registration form with Laravel 8 and Angular 13. The back-end is an API (link to Github repo). In the UserController I have a signin() and a s

Laravel Json Reponse running really slow

My code suddenly started working really slow. I don;t see any reason, noting was changed or updated. return response()->json([ 'status' => 'su

Laravel Carbon difference in time

So I have this table with a start time and an end time and I am calculating hours. This works just fine unless the end time is midnight. I have TIME fields in m

Livewire filter with multiple conditions : How to?

I am in trouble with a little functionnality I want to add in my project, sure someone can help me :) The stack is Laravel with Livewire to add easily some inte

Truncate string with html tag in Laravel

I want to truncate in Laravel text from database with HTML Tag, for example: <p>Hi. I want to say about my story. </p> I found a method: {{ Str::li

Error Missing required parameters for [Route] after upgrading Laravel 5.8 to 6.0

After upgrading Laravel 5.8 to 6.0 I get the below error: local.ERROR: Missing required parameters for [Route: playlist-song.show] [URI: public/admin/playlist-

Laravel blade set value on input with ternary if

I have a template that change the style if into an input is set the "value" attribute or not, even if it is empty. For example this: <input type="text" class

Laravel request()->all() is empty in booted function when running tests

I created a trait sets up some Global Scopes based on the query parameters. It does that by reading from the request() helper and reading the query parameters f

Display user name from another table Laravel 8

Hellow guys, so I have 2 tables is Listings is Users in Listings I have some columns, one is user_id, and is related to users tables. I want to display the user

laravel jetstream login and register layout is spoiled

enter image description hereI want to create login and registration with the help of jetstream in laravel. i followed all steps perfectly but my jetstream logi

Right way to save timestamps to database in laravel?

As part of a standard laravel application with a vuejs and axios front-end, when I try to save an ISO8601 value to the action_at field, I get an exception. clas

How to add image props array in resouce?

In laravel 9 I want to join $CMSItem object and properties of related image(I use spatie/laravel-medialibrary) in one resource, having in control : $CMSItem = C

Laravel validation for numbers and hyphens

How do you validate the numeric values with Hypen's (-) ? I just want to validate the numeric value with Hypen's and without Hypen's. Thank you so much ! For ex

Can't send mail with Lumen framework and no error appears

Since yesterday I have had problems sending emails with Lumen. I think I have followed all the steps in the documentation correctly, but unfortunately I cannot

How to make notifications as well deleted when deleting particular message on a chat box

I am developing an application using Laravel and Vue JS which includes a chat feature also. When user sends a new message admin gets a notification. Now i want

Laravel Livewire Tables - Filter not working

Noob question (sorry in advance if it's dumb) but I'm honestly trying to understand it all. I'm new to Laravel and still finding my way around. I'm using Larave