Account for fuel in the finance calculations #313
This commit is contained in:
@@ -28,6 +28,7 @@ class MigrationService extends Service
|
||||
public function syncAllSeeds(): void
|
||||
{
|
||||
$this->syncAllSettings();
|
||||
$this->syncAllPermissions();
|
||||
}
|
||||
|
||||
public function syncAllSettings(): void
|
||||
@@ -43,6 +44,22 @@ class MigrationService extends Service
|
||||
}
|
||||
}
|
||||
|
||||
public function syncAllPermissions(): void
|
||||
{
|
||||
$data = file_get_contents(database_path('/seeds/permissions.yml'));
|
||||
$yml = Yaml::parse($data);
|
||||
foreach ($yml as $perm) {
|
||||
$count = DB::table('permissions')->where('name', $perm['name'])->count('name');
|
||||
if ($count === 0) {
|
||||
DB::table('permissions')->insert($perm);
|
||||
} else {
|
||||
DB::table('settings')
|
||||
->where('name', $perm['name'])
|
||||
->update($perm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $key
|
||||
* @param $attrs
|
||||
|
||||
Reference in New Issue
Block a user