15 Laravel Tips to Work in a Team

15 Laravel Tips to Work in a Team

Laravel Daily

3 года назад

17,036 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Gaurav Pal
Gaurav Pal - 26.02.2023 14:38

How to remove constraints using migration when data is already present.

Ответить
WhiteSiroi
WhiteSiroi - 26.11.2022 13:59

awesome, love it, thank you LD

Ответить
Giacomo Garavaglia
Giacomo Garavaglia - 01.05.2022 11:37

I know it's an old video, but I faced aproblem recently: dev1 working on feature_1, dev2 working on feature_2 at the same time. Dev1 creates some migrations and execute it on his machine. Dev2 do the same, but dev2's migrations are create before dev1's. So when both merge their work, and dev1 will run migration, to migrate dev2 work, nothing is migrated due to the date of creation of that migrations. Is there a way to solve this?

Ответить
Hrk
Hrk - 22.04.2022 21:11

you are best

Ответить
Víctor González Toledo
Víctor González Toledo - 09.09.2021 12:22

Thanks! I'll see it later.

Ответить
kaf83
kaf83 - 22.06.2021 04:31

I think I disagree with editing migrations. In a project that isn't in production, you should always edit existing migrations. Most db changes happen in development and if you keep adding new migrations you could end up with a thousand migrations by the time the project is ready to launch.
Everyone should be running migrate:fresh in development constantly. So editing migrations shouldn't be a problem.
Then once the project is in production, switch to adding migrations for db changes. That is what migrations are primarily for, safely updating production environments.

Ответить
RexCode
RexCode - 16.06.2021 03:06

Don't want to be over on easy thing, but when working with other people, don't be lazy on naming more helpful commit, add a little description if the commit not obvious. Take some time to add comments for the commit if using cloud repository

Ответить
Ricko
Ricko - 15.06.2021 09:31

All good

Ответить
SHAKIL MAHMUD
SHAKIL MAHMUD - 12.06.2021 08:10

This video will definitely help me
Thank you very much.

Ответить
Rahul Baruah
Rahul Baruah - 11.06.2021 15:18

Great tips. Thanks.

Ответить
zakius
zakius - 10.06.2021 19:33

for admin users I prefer making an interactive command, this way I'm sure the password is never committed and I won't forget to change it

Ответить
f00n
f00n - 10.06.2021 18:04

Thank you so much

Ответить
Sandeep Baraskar
Sandeep Baraskar - 10.06.2021 14:48

Very helpful tips.. thanks 😊
Just wanted to know, how to create or maintain the UML diagrams for the big project and documentation of the flow of code in laravel...

Ответить
InSO
InSO - 10.06.2021 12:23

Another great video! It was very difficult for me to work in team for the first time. If I had found video like this one, I think everything would be better ...
Only one thing I prefer in another way:
I use guarded instead of fillable and throw 'id' as first element of array (to prevent overwrite). In that case, if someone add new column in table, the column should be not declared in fillable. Yes, is not so readable, but is more easy and (still) secure and I provide a case of my experience - one of my teammates add new column in existing table with dozen of relations (the most of relations was not cascade) and for some reason he did not delcared it in fillable. I pull and try to create new record in db and Laravel throw me error - this column is not fillable. So, from this moment, I just add (for most projects) trait with protected $guarded = ['id'] and use this trait in base class.
Thanks for the great video, Mr. Korop!

Ответить
Oliver Sarfas
Oliver Sarfas - 10.06.2021 11:22

RE: Using Seeders

Use migrations for creating REQUIRED data such as foreign key tables for enums, or adding new data to existing tables (static data that is always required, status table for example).
Seeders are good for adding demo / scaffolding data, however are not easily reversed in a production environment

Ответить
İlker KOCATEPE
İlker KOCATEPE - 10.06.2021 10:33

Thank you for useful tips

Ответить
javiershaka
javiershaka - 10.06.2021 10:12

In the part form request is good practice make one request for model ? for example make:request UserRequest and apply switch case with methods (get, post, put, patch, deleite, whatever method).

Ответить