adspace


How to use custom table in laravel modal?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is current stable version of laravel?

870


Do you know what version of laravel do you generally use?

839


Tell us have you used lumen before?

808


What is latest version of laravel?

868


How much laravel experience do you have?

815