I’m trying to send a message to selected users with their names. So let’s say I have two users Ethan and Calvin then the message should start like User1:(Hi, Ethan), User2:(Hi, Calvin). So far the message is like (Hi, Ethan,Calvin) for every user. How can I fix this? Blade Controller Answer It loo…
Tag: laravel
Laravel 7 – paginate sorted by DESC
I’m trying to display posts from the database, but i want to have the latest on top. This means I have to do this inside of my HomeController.php: But when the site grows up, it might be complicated to find the particular post, so I decided to implement pagination. Unfortunately, pagination only works w…
Large amount of data. Best way to iterate over, without getting memory exhaustion?
Using Laravel 6, and so Eloquent Collection classes. So I have a “lot” of data to process. Roughly 5000 rows, and when fetching it, this generates a Collection of 5000 models. Now each of those models has maybe 20 attributes that need to be read. Is there a fast way to do this? I currently have an…
Laravel eloquent update column using relationship column
How can achieve this query? Sale::with([‘catalog’]) ->whereIn(‘id’, $ids) ->update([‘price’ => DB::raw(‘catalog.price’)]); This is not working, it shows undefined table… I tried to …
jobs failed table using redis as queue driver in the Laravel
I’m using Redis as a Queue Driver for my jobs, but the failure table receives a specific driver configuration in the config / queue.php file, which left me a little confused. Because even setting …
Laravel: How to store Excel File in a given path?
I have a function which is converting my blade view into Excel format and downloading it. Now I want to save it in a specified location, i.e: public/uploads/release Here is my controller: public …
Custom verificarion email in laravel issue
guys in my laravel application i’m trying to send my users a custom verification email, as i’m using language translations So as the first step I’ve created following custom email template in my App/…
Laravel foreach loop error message: Server Error in Controller
I pull the data in json format, but I can’t access the sub-elements in some way, it’s not oddly worth it, it only takes the first character. $log_example = $request->all(); $logs = json_encode($…
How to create custom validation rule for dependent input fields in laravel
In my input form, I have two fields; momentFrom & momentTo. I need to put a validation which gives error message if any of the following criteria fails. momentFrom is greater than or equal to …
User not loged in after redirect from login with laravel socialite
Hello I am using Laravel Socialite for Oauth authentication with my remote Laravel Paspport app. After getting successfully the user autheticated with passport when I want to get the user to the …