Trying to migrate a users table. Already have 1 table at DB. It’s Contacts for contact form. Trying to migrate a users table. Created my table with terminal $ php artisan make:migration create_users_table Had the following code in it. When I tried to migrate the table terminal returns an error. I run php artisan migrate and it returns Migrating: create_contacts_table
Tag: laravel
How to apply Eloquent where() to child in hasMany() relationship
I want to get the results of this very simple, common SELECT statement: For the non-SQL fluent, this returns all of the columns for all parent and child rows where the child column named column contains the value 1. Using the Laravel models below, what’s the correct Eloquent way to do this? Answer You were close with your last attempt;
How to set onEachSide at controller level on laravel?
How to set onEachSide at controller level on laravel? on blade we use: How this can be done at controller level? Answer
Call to undefined method IlluminateDatabaseEloquentBuilder::links() error when attempting to paginate
I’m trying to create a simple filter system with a search box, service, category and a way to sort the items in my laravel controller. However, I am getting an error links() when I try to filter anything even though I think I have paginated correctly. Here’s my function: Can anyone give me some advice on this problem? Thanks! Edit:
How to upload file using laravel vue api?
i’m trying to make a form with the ability to upload files using form i’m able to store string, int data but i’m a bit lost with the way that i need to provide for the controller and the view this is the add template: this is the database table: controller: model: app: i can provide more code if necessary
Laravel query builder inject column value into Carbon query
I’ve got a query that I’m running in my project on a model called Domain, it returns all domains where the status column of a domain matches complete and a date column is before or equal to a specific set of days. I’ve recently refactored the model columns and have included a new column called domain_alert_period which is an integer
Why doesn’t my php laravel application store my image?
I’ve looked at code from other people and try to implement the same thing, but the application could not store the image to the desire folder, would you please have a look at what the reason is? Thank you! Here is my code for route: Here is my code for the php laravel template: Here is my code in the
Undefined Array Key “”
I am new to laravel so this particular error is giving me headache. I am trying use a datatable in laravel vue.js app. I have the following code in my laravel backend and when I try retrieving the data from the data, I get the Undefined array key error message in the dev tools. How do I resolve the issue
Where to store user profile id for multiple user profile in laravel [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 9 months ago. Improve this question In my laravel project, I have 2 tables as users and profiles. One user can have multiple profile. The user is
How to active and inactive boolean in Laravel
I want to know how to make a Boolean data true or false in database whenever my button is clicked. I already can perform a true when button is clicked, I want to know how to make it false. I hope I can get a answer thank you! BTW, this is my first time to post a question here and