PHP code example of lacodix / laravel-data-migrations
1. Go to this page and download the library: Download lacodix/laravel-data-migrations 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/ */
lacodix / laravel-data-migrations example snippets
return [
'table' => 'migrations_data',
];
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
public function up(): void
{
DB::table('example_settings')->insert([
'key' => 'timezone',
'value' => 'UTC',
]);
}
public function down(): void
{
DB::table('example_settings')->where('key', 'timezone')->delete();
}
};