How to use custom table in laravel modal?
Answer / Mujeeb Akhtar
To create a custom table in Laravel model, you can follow these steps: 1. Run the migration command 'php artisan make:model ModelName -m' to create both a new model and a migration file for your custom table. 2. In the generated migration file, define the schema for your custom table using the 'up()' method. 3. Execute the migration with 'php artisan migrate'. 4. After creating the table, you can use it in the respective model.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain how to get current url in laravel?
How can someone turn off csrf protection for a specific route?
What are guards in laravel?
What are some use valet commands?
Please explain what is laravel?
List out some artisan commands?
How to use updateorinsert() method in laravel query?
What is mvc framework?
Explain dependency injection?
What is contract in laravel?
What are the benefits of laravel?
Explain how to localize resource uris in laravel?