Slim 4 Authentication (Lesson 10: Database Migrations, Seeds, & Factories)

Опубликовано: 12 Октябрь 2024
на канале: Zak H.
2,784
37

#Slim4Authentication #Slim4Migrations #Slim4Database

Alright, this one is going to be exciting ~ we're going to set up database migrations, seeds, and factories.

Database Migrations allows us to control the structure of our database within our codebase. Database Seeders allows us to populate our database with data without needing to manually add the data. Factories will allows us to create dummy or faker instances of our Eloquent Models. We will still be able to custom values and override faker data, but by default all we'll have to do to create a dummy instance is run

factory(User::class, 5)-create([
'first_name' = 'hard coded first name overriding faker created first name'
])

Let's dive in and really improve our lives as developers and engineer, setting up an environment that is truly enjoyable to work with!

~~~~~~~~~~~~~~~~~~~~
Clean Code Studio ~ Simplify!
Clean Code Clean Life
~~~~~~~~~~~~~~~~~~~~
https://cleancode.studio

~~~~
Database Migrations/Seeds Package
~~~~~~~
https://book.cakephp.org/phinx/0/en/i...

~~~~
Faker Data package for factories
~~~~~
https://github.com/fzaninotto/Faker

~~~~~
Github Repository
~~~~~~~~~~~~~~~~~~~
https://github.com/zhorton34/authoriz...

~~~~~~~~~~~~
Npm JS Packages
~~~~~~~~~~~~
https://www.npmjs.com/~zhorton999

~~~~~~~~~~~~~~~~~~~~~
Packagist (Composer) Packages
~~~~~~~~~~~~~~~~~~~~~~
https://packagist.org/users/zhorton34...

~~~~~~
LinkedIn
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  / zak-horton  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~