Skip to content

Tag: laravel-8

How to Install Swagger to Laravel 8 API for documentation?

Installing Swagger for the First Time in laravel 8 Getting Error like: Answer I’m guessing the URL you’re hitting might be incorrect. Change it to just docs/api-docs instead of docs/api-docs.json. In addition, if you haven’t ran the generate command already, you would have to do so to make i…

Only some values are editing with a form Laravel 8

I am using a form and I don’t know why I can edit with it the values except in the fields apellido and cedula. I am using the same logic in all the form fields so I dunno what can be causing it. I’m gonna post the code of the view, controller, and model. View Controller Model I have no

Query One to Many Relation in Laravel 8

I have one to many relation for User and Student. Model User.php Model Student.php and in Controller.php it will run and return json can I custom select in Students, only show firstname and lastname ? Answer You should use API Resources for this. Here’s a link to the official documentation: https://lara…

find() does not get the existing row

I have a resource Controller with this index method like this: But it returns this error: Trying to get property ‘slug’ of non-object And when I dd(Category::find(25), Category::find(24), Category::find(23), Category::find(22)); I get NULL results. Meaning that it can not find data with specified …