I am looking for a way that my ProductResource Collection will only include products with active prices. In my routes/api.php am using a Collection a ...
I am looking for a way that my ProductResource Collection will only include products with active prices. In my routes/api.php am using a Collection a ...
I'm trying to build an API in Laravel 9 and want data from a pivot table. I want to retrieve all instances, whether they have sessions assigned to th ...
I'm confused why casted props are inaccessible in the blade file. When I try to check it in the controller its showing properly. Here's the JSON show ...
I've got a Category resource that looks like this: parent is the ID of the category's parent, which is itself a Category. When I call the endpoint ...
I'm using PHP8.1 and Laravel 9 for a project in which I've got the following enum: one of the classes listed in the enum looks like this: all ...
I have the following resource being returned: { "id": "b93244c5-0c1e-4388-bd61-fd577b5c7c57", "state": 3, "createdAt": "2022-08-03T13:58:27.00 ...
I have downloaded a project and I noticed that the project use views from different directory not the usual directory which are but instead it crea ...
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 : ...
I have two models related to each other with a one-to-one relationship. Model A belongs to model B and when an instance of model B is returned to the ...
I am trying to group the result with the status name inside. I am not doing groupBy after collection because I am using resource to return data, there ...
I am creating an API using Laravel. I created a table called transaction. I also created a resource called transactionresource. I want to change the ...
I have 3 tables business, service , service_venues. I need services of business having service_name = $search and and get venues of selected services. ...
I'm fetching data to paginate but pagination is not working, the fetch response is added below, if I return the query relation it retrieves correct da ...
So I am trying to control output utilizing resources as I was told it's the best way to model the data for api output. Customer Model Invoice Mode ...
I have a custom attribute that calculates the squad name (to make our frontend team lives easier). This requires a relation to be loaded and even if ...
PHP 7.4.16 & Laravel 8.61 I have the following code in my Resource: Where $ta->id is a integer. When I print the Resource::collection of a ...
I have two models, User and Comment, Each User can have multiple Comment, I can call paginate(3) on User and get 3 User in output per page but I need ...
This is my first time posting here so please pardon my errors: I have a search functionality whose route is: Currently, I have an eloquent relatio ...
In lumen 8 app I use resources and reading here https://laravel.com/docs/8.x/eloquent-resources I try to use “with” method, as I want to add some met ...