Skip to content
Advertisement

Tag: laravel

Configuration observer in Laravel

I am beginner in Laravel. I use in my project Laravel 8. I have this code: Controller Model Observer ServiceProvider I have 2 questions / problems: How can I disable following in the controller (index method)? I only need to record the moment when someone opens one record for editing, and does not list all the records in the list

Laravel 8 eloquent query delete

How to delete the aircon in database when there is no any data. Order and Aircon are many to many relationship. Answer try whereDoesntHave Edit: You can also add new column aircons_count will old number of aircons for every order which will be faster than the above query and run the query like the following: Note: make sure to add

array_push replacing value instead of adding new value in array

I’m trying to make a cart system, which is I need to sum all total product. I’m thinking about saving the total to an array, so I can use array_sum it later. But somehow the array $total_cart[] only have last total, for example is if I have three product in my cart, the total saved in the array is only

Laravel – simpliest elseif [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 7 months ago. Improve this question Hi, have i to do it more simple or its a normal practice? Answer Instead of using if-else, I would recommend

Return S3 private file as stream

I’m currently working on a route for a project that I need to get a specific file from S3, read its content, and return as a binary. I can’t just use the S3 file url, because it is private and it is intentional (we just don’t want the bucket files open). But the problem is, I want to stream it

Advertisement