Try to clear caches before updating (#522)

* Try to clear caches before updating

* Add clear-compiled to maintenance cache list

* Formatting
This commit is contained in:
Nabeel S
2020-01-30 14:59:48 -05:00
committed by GitHub
parent 3c1b433c29
commit 51b50972c8
4 changed files with 39 additions and 0 deletions

View File

@@ -2,7 +2,9 @@
namespace App\Contracts;
use App\Support\Database;
use DB;
use Illuminate\Support\Facades\Log;
/**
* Class Migration
@@ -23,6 +25,22 @@ abstract class Migration extends \Illuminate\Database\Migrations\Migration
{
}
/**
* Seed a YAML file into the database
*
* @param string $file Full path to yml file to seed
*/
public function seedFile($file): void
{
try {
$path = base_path($file);
Database::seed_from_yaml_file($path, false);
} catch (\Exception $e) {
Log::error('Unable to load '.$file.' file');
Log::error($e);
}
}
/**
* Add rows to a table
*