PHP code example of mylesduncanking / laravel-simple-migration
1. Go to this page and download the library: Download mylesduncanking/laravel-simple-migration library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mylesduncanking / laravel-simple-migration example snippets
protected array $migration = [
'TABLE_NAME' => [
'COLUMN_NAME' => ['MODIFIERS'],
// Additional columns...
],
// Additional tables...
];
protected array $seeders = [
'roles', // This will translate to (new \Seeds\RolesSeeder())->run()
];
config/simplemigration.php > type_assumptions
protected array $migration = [
'table_to_be_created' => [
'id',
'name',
'date:dob' => ['nullable'],
'timestamps',
],
'table_to_be_updated' => [
'name' => ['after:id']
],
'create:pivot_table' => [
'foreignId:key_1' => ['index'],
'foreignId:key_2' => ['index'],
],
];
protected array $migration = [
'roles' => [
'id',
'name',
],
];
protected array $seeders = [
'Role'
];
bash
php artisan vendor:publish --tag=simplemigration
bash
php artisan vendor:publish --tag=simplemigration
bash
php artisan vendor:publish --tag=simplemigration