Download the PHP package eyf/laravel-exodus without Composer
On this page you can find all versions of the php package eyf/laravel-exodus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eyf/laravel-exodus
More information about eyf/laravel-exodus
Files in eyf/laravel-exodus
Package laravel-exodus
Short Description Laravel YAML migrations
License MIT
Homepage https://github.com/eightyfive/laravel-exodus
Informations about the package laravel-exodus
laravel-exodus
Converts YAML to actual Laravel migration files.
Install
Usage
Step 1: Create database/migrations.yaml
file
Define a posts
table:
Step 2: Make migrations (command)
Run exodus
command to translate the yaml
file into actual Laravel migration files:
Step 3: migrate
as normal
Workflow
Exodus is a DEV package, it is meant to ease / speed up development time.
A normal workflow while DEV'ing could be:
- Create
migrations.yaml
file (Add aposts
table) php artisan exodus
php artisan migrate
- Edit
migrations.yaml
file (Add ausers
table) php artisan exodus
php artisan migrate:refresh (--seed)
- Edit
migrations.yaml
file - ... (Repeat)
The exodus.lock
file
By default the migration file names won't change between multiple exodus
runs.
This is because Exodus keeps track of the initial migration file name in database/exodus.lock
(to commit in your repository).
This makes sure git
sees the edits in the same migration file throughout the whole DEV.
The force
option
Sometimes you may want to bypass the exodus.lock
file (For example when you want to change the table order creation).
What happens:
- All "old" migration files will be deleted (the ones in current
exodus.lock
) - New migration files will be generated (with newest date in filename)
Syntax
Column
Any column can be written fluently exactly like in the Laravel migration syntax. In fact Exodus is just a light translator of a "dot notation" array
to the actual PHP syntax.
Special column
Special column types are the "sugar" methods provided by Laravel for a better developer experience: id()
, timestamps()
, softDeletes()
, rememberToken()
, etc...
Since these column types don't have a column name (name is in the convention), just specify true
as their value:
Pivot tables
For generating a pivot table, just use two table names as follow:
This will create the following pivot migration file:
You can even provide more columns to the pivot table as normal:
Phylosophy
This package aims at speedind up development time. It is not meant to be used after you have launched to production. In fact the package does not provide a way to run migrations for adding or removing columns (it used to).
This is by choice.
While DEV'ing you should edit the migrations.yaml
file as much as you want and run migrate:refresh (--seed)
as often as possible. "This is the way".
By the time you are happy with your Schema, you must have launched in production, and then only you may create normal Laravel migration files for adding or removing column(s) in your tables. This is where the job of this package ends.
TODO: Implement safety guard making sure exodus
cannot be run if it detects more migrations files than in exodus.lock
.
All versions of laravel-exodus with dependencies
illuminate/support Version ^5.8|~6.0|~7.0|~8.0|~9.0|~10.0
illuminate/filesystem Version ^5.8|~6.0|~7.0|~8.0|~9.0|~10.0
symfony/yaml Version ^5.1|~6.0