#Tips for working in a team on Laravel Project

2 messages · Page 1 of 1 (latest)

tough glen
#

Use Laravel Pint to lint your code.
Use Larastan to fix your code (don't go above level 5 if you don't have a good PHP/Laravel/PHPStan Knowledge).
Take care to EOL (LF/CRLF) because your using Linux/Windows.

burnt magnet
#

A few things I'd recommend:

  • Use Sail, this is not a requirement, but it makes development in a team much easier, as you'll all use the same environment
  • Follow Laravel best practices and recommendations. For example when naming tables you use the plural name, a books table with a Book model. This way you don't have to "fight Laravel" and everyone knows where to expect things
  • Use migrations and treat them as version control for your database. This means if you create the books table in a migration but later forgot to add the in_possession_of column you'd create a new migration where you only add this column to the table. Don't rewrite migrations
  • Write a few tests, even if they're really basic feature tests that just do $this->get('/')->assertOk(). Even having these basic tests makes it easier to see if things still work