New in Laravel 8.37: Anonymous Migrations with no Class Names

preview_player
Показать описание
A new feature released this week in the newest minor Laravel version, which allows to use PHP Anonymous Classes for migrations and avoid naming conflicts in the future.

- - - - -
Support the channel by checking out our products:
Рекомендации по теме
Комментарии
Автор

I opened this feature request on 2014, now we can finally use this <3

joaocagnoni
Автор

Short and clean explanation. Thank you.

petritmekuli
Автор

It's very easy solve naming conflicts in migrations. People should name more detailed mutations of migrations.

bumblebity
Автор

Many thanks to you and the community for making this the best web framework ever.

abelenocrodriguez
Автор

Sweet! Thank you! Have a nice and productive day!

beatnu
Автор

Not sure how I feel about this. Yes it’s a nice convenience, but a convenience for something that very rarely occurs. Not only do we have schema:dump —prune which would solve this issue for long-standing projects, but it occurs so rarely that this perhaps seems like a cannon/mosquito solution.
Still, great to know it’s there. Thanks for the vid!

mindfullsilence
Автор

Cool, I just had that problem 2 weeks ago, with same class name :)

raidoorumets
Автор

Thank you interesting video !
i will try it!

AntoninoDiGiglio
Автор

I have a package that I do need instantiate the migration class itself, and I wanted to change it to a convenient way as the framework changes.. but, im struggling when I run the Test because it's anonymous now. how can i run the up method on migration with anonymous class? am I missed something?

akunbeben
Автор

Always adding migrations so: php artisan make:migration alter_users_`date +%N` and no name conflics. Why don't add random number/string to class name from the box?

ИгорьД-кч
Автор

is there any way to use stubs code generator outside laravel?

fcolecumberri
Автор

> 1:06 but when it throws the error then you realize you already have a migration for that so you can now modify that existing migration, I can see no problem... or there's something I'm missing here?

ricko
Автор

I’m honestly torn about this one. I don’t like how Laravel handles migrations but Ik there’s worst approaches to that.
Just because this fixes “bad migration names” doesn’t mean the whole system is a good one. It might be that we are used to a bad migration system and this leads to a better way.
Or do you honestly like having a poop ton of files in your project ordered by timestamp? I sure don’t! I like to have all my stuff related to a topic inside a single file or even have a split between regular fields and table relationships.
Idk, imo as it is this could be in L8 but if it’s pushed into L9 I expect more than that.

gustavoaeidt
Автор

Sir. Please make a video on paypal integration in laravel

NotBeHaris
Автор

I'm not exactly a fan of this change, I'd prefer if the command checked if names are not duplicated instead as names should be as descriptive as possible so you know what happens inside without opening the file, of course it breaks nothing so it's not a big issue

ZKIUS
Автор

To everyone still interested in his sanity. Start using Symfony.

AenGex
Автор

In all seriousness, as a Senior Software Developer, do you really promote anonymous classes? Show some respect to yourself and the impact you may have to junior developers, please.

AenGex
visit shbcf.ru