0

So basicly i have started working with laravel. And to this moment i have been writing migrations and defining the fields there. And after that i should create a model related to it and define the relationships there. Unlike the Django framework where you define fields and relationships inside a model and migrations created automaticly.

Thus my question is: Is there any other way of writing the migrations so that i don't need to write models as well. Or am i stuck with writing everything myself?

I have tried: php artisan make:model User -m in console, but it only creates the file and that's it

Would appreciate the sources if there are any

  • 4
    same way you use `php artisan make:model` you can do `php artisan make:migration`, the `-m` does the same thing – kris gjika Aug 29 '23 at 08:05
  • 1
    You can always use https://drawsql.app/ to generate the Laravel model and migration file. – Nehal Aug 29 '23 at 08:44
  • You can check this discussion https://github.com/laravel/framework/issues/6927. – klido Aug 29 '23 at 12:33

0 Answers0