I’m having a problem with the excel formatting of export operation, here’s my code SubmissionDetailExportExcel.php pengajuan_detail.blade.php When i opened the exported file, it became something like this: The second data after the first one goes to the right instead in the same column, how do i fix this Answer Fixed it by deleting the “rowspan”
Tag: laravel
Laravel 9 with argument 2 must be of type ?callable, string given
I’m following a tutorial. In the controller I’m using with to send a success message. I’m getting an error message once the form is submitted and I’m redirected to the index page the code there looks like this. This is the error message: with(): Argument #2 ($callback) must be of type ?callable, string given, called in C:laragonwwwrecipe_projectappHttpControllersRecipeController.php on line 49
How to get last record of duplicate data using group by in Laravel SQL
I want to retrieve last record of multiple row of same id using GroupBy in my laravel project. table purchases query in laravel controller output But Only id no 3 will be the output cause only id no 3 purchases id has due amount. How to solve this? Anybody Help please? Answer Looking at your requirement, you can add a
Data output from the database
I have a select and I want to output data from the DB In CreateController I wrote this I have a UserGuild database And I have such a mistake I need to output to select what is in the User Guide database, but at the same time where {{$guild->name}}and value were were values from the Guild database I also tried
Apache not return Laravel json validation errors on Test but works on Dev
I’ve been working on a Laravel API with validation. I’m sending this request to the server: On my development system, running windows/Apache/PHP 8.1, the POST requests return a JSON object containing validation errors. But my test system, running Linux/Apache/PHP 8.1, does not return a JSON response: Here is my code: api.php StoreClientRequest.php ClientAPIController.php Since it’s working on my localhost I
Laravel : Combine two tables using Model relations
i have two tables :: shops and attachments . Shops has all the details for shop and attachments with all the pictures for shop with ref_id as FK . now for mobile app i have to list shops with Shop title and one image. I can achieve it using leftjoin as below. This returns just shop name and pictures ,
How to implicitly binding multiple Eloquent models in a single route definition?
Laravel9 document says: When implicitly binding multiple Eloquent models in a single route definition, you may wish to scope the second Eloquent model such that it must be a child of the previous Eloquent model. For example, consider this route definition that retrieves a blog post by slug for a specific user: When using a custom keyed implicit binding as
Laravel API controller return object along with other arguments
In API controller index function $response holds id’s of media items from db table And if $is_published_pack == ‘false’ I’m successfully returning How to append $response inside when $is_published_pack true condition is met? $response value is I’ve tried for example doing this but it throws error Complete API controller index function: Answer you may try this: hope this solves your
Laravel check if belongstomany contains belongstomany
in my system: a lead belongstomany salespeople a manager belongstomany salespeople i am trying to check if a lead has a manager through the salespeople. this is for a policy so i can make sure a manager can see the leads of their salespeople. something like this: is there a collection method that will allow me to do this? i’ve
Update not working in Resource Controller for Laravel 8
Previously, I was trying for a few hours to get my “destroy()” function working. Which would sound ridiculous to most of you but simply putting “method(“DELETE”)” in the form made it work, which I still don’t why. Now, I’m stuck with the update() function. Once I click update, the page just reloads and does nothing. It doesn’t update the info