#[blueprint] migration sequence

30 messages · Page 1 of 1 (latest)

faint plinth
#

I have problem with the sequence of my migration files
I used https://blueprint.laravelshift.com/ to create User model and some other
I have one of the packages are old made at 2023 ,and you can notice other conflicts already

is there a way to fix it without doing the renaming? I need for more robust solution

Blueprint

A code generation tool for Laravel developers to rapidly generate multiple Laravel components from a single, human readable file.

fathom axle
#

What is the conflict/error?

faint plinth
fathom axle
#

User beign the model

faint plinth
#

so reference by model

fathom axle
#

Yep

faint plinth
#

is this one of laravel 12 features

fathom axle
#

Iirc it is from laravel 10

#

Os something like that

faint plinth
#

very nice but I have to make the models first ?

fathom axle
#

To reference on the migration? Yes

faint plinth
#

hmm

#

is this right thing to do ?

#

becasue I thought the sequence is migration then models then controllers

fathom axle
#

Usually i create models with the migration

#

And just add fields/relations as needed

#

php artisan make:model User -m

faint plinth
#

interesting

fathom axle
faint plinth
#

If you would like to generate a database migration when you generate the model, you may use the --migration or -m option:

php artisan make:model Flight --migration

I see even here they make models with migration

#

that's nice

fathom axle
#

You can have a model without a migration

#

Or a migration without a model

#

But if you are following and using eloquent (you cannot not use eloquent with laravel) you have to have both for the model to work

faint plinth
#

thanks for sharing , this will change how I code becuase I always think to make migration first

fathom axle
#

Blueprint is just a boilerplate for easier model/migration definition

faint plinth
#

I need to see how to use the solution you provided above with the blueprint

fathom axle
#

I've never used blueprint before, so i may say something wrong about it