PHP code example of kerroldj / laravel-migrate-fresh-table
1. Go to this page and download the library: Download kerroldj/laravel-migrate-fresh-table 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/ */
kerroldj / laravel-migrate-fresh-table example snippets
use Kerroldj\MigrateFreshTable\Contracts\FreshStrategy;
use Kerroldj\MigrateFreshTable\Support\FreshContext;
class ParquetImportStrategy implements FreshStrategy
{
public function name(): string
{
return 'parquet';
}
public function recreate(FreshContext $context): void
{
// $context->table, $context->connection, $context->schema,
// $context->schemaBuilder, $context->pretend, $context->options
$context->schemaBuilder->create($context->table, function ($table) {
// ...
});
}
}
use Kerroldj\MigrateFreshTable\Events\TableFreshed;
Event::listen(TableFreshed::class, function (TableFreshed $event) {
logger()->info("Freshed {$event->table} on {$event->connection}");
});