Skip to content
Advertisement

Tag: laravel

Import CSV data using Laravel

I’m trying to walk through as CSV file and extract all its contents. After the contents are imported I need to insert them into my mysql database table but before I can do that I need to check if these records exist. If a record does not, import this register. I’ve got headers and all content and I had created

I can’t add a column to a table with data in laravel

I’m doing this: create: Code: The migration runs without problems, but I am going to check the table and the column is not added, if I create a new migration and put a total to the new column, it says that the column already exists, what error is occurring? Answer go to the database table and delete the previous total

Laravel Resource controller

How do I tell my API to display a particular result based on another column? e.g. localhost:8000/api/gadgets/{{id}} Normally it returns the particular information of the specific gadget with that ID and localhost:8000/api/gadgets/{{imei_code}} does not return any value or an error whereas imei_code is a column that I needed to pass as a GET request… I’m using the normal resource controller

Surely noobie Laravel Question: Undefined id? Why? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 9 months ago. Improve this question I’m trying to edit the data saved in my DB, and I’m completely lost. In my PostController the index, create,

Laravel 5.8: Weird Error Trying to get property ‘created_at’ of non-object

I’m using Laravel 5.8 to develop my project and in this project, I have a OneToMany relationship between Member Model & Student Model like this: Student.php: Member.php: Then at the Controller, I added this: Now at the view I want to get created_at timestamp like this: $customs->find($student->mbr_id)->created_at But this will return this error: Trying to get property ‘created_at’ of non-object

Laravel validate() method returns index html page when false

I’m building my first laravel API and when I try to validate some mock form data using Postman with POST method, the application returns to me the HTML of the index page and status 200. Here is my code The application returns the object that was inserted in the database if the validation was successful (if the data was filled

Relationship eloquent in laravel?

In user: In post: I handle in controller: Then I get an array and the result returned is exactly what I need. But when I query this way because I need to get a lot of data, the result is an empty array. What did I do wrong? In UserController.php: Please give me any comments. Answer You have to select

Advertisement