Laravel Pro Tips
#migrations
#Laravel Migration Tip π₯ You can use the `from` method to set the starting value of an auto-incrementing field.
Gurmandeep Singh
#migrations #database
#Laravel tip π₯ virtual generated column
mahmoud Adel
While adding a New Column to existing table using Migration, the column is always added at the last.β You can use the after() to place the New Column after a specific column.β You can also use the first() to place the New Column at the start of the table. #Laravel #PHP
Aftab Khan π
π₯ I have been using #Laravel for years and I just discovered the migrate:status command. It shows you which migrations have run so far.
Sanjit Singh
#migrations #seeders
π₯ #Laravel Tip: Sometimes you need to seed a database with millions of records e.g. for stress-testing. To avoid crippling the DB with millions of βcreateβ queries, instead consider βmakingβ a large collection of models, then chunk and insert them.
Matt Kingshott
π₯ Laravel Tip: In your migrations, you can add multiple columns after another column using the after method.
Cosme Escobedo
#Laravel Tip π₯ : Now you can add the column in the database table only if its not present & can drop it if, its present. For that following methods are introduced: π whenTableDoesntHaveColumn π whenTableHasColumn Let's see example: #PHP #100devs #100DaysOfCode #webdeveloper
Mohammad Haris β‘
#migrations #eloquent #database
π₯ #Laravel #Eloquent Tip: The new concept "invisible column" in MySQL8 enables you to hide the column value when you run the `select *` query. To get the value you need to `select` explicitly. In Laravel use `->invisble()` in table migration. #Database #PHP
Laravel Eloquent
#migrations #models
π₯ #Laravel Tip: you can define default values for columns in two places: Migrations and models. Via Models you can specify default attribute values and change them time by time only in code level, while in migration you need to write extra migration. #Laravel $Tip #Php
No articles were found.