mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#3025 Making the announcement status flexible.
This commit is contained in:
parent
7f9257e164
commit
1b8eac4be3
@ -1,10 +1,12 @@
|
||||
<?php namespace Visiosoft\AdvsModule;
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
||||
use Visiosoft\AdvsModule\Status\StatusSeeder;
|
||||
|
||||
class AdvsModuleSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$this->call(StatusSeeder::class);
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,41 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Status;
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
||||
use Visiosoft\AdvsModule\Status\Contract\StatusRepositoryInterface;
|
||||
|
||||
class StatusSeeder extends Seeder
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the seeder.
|
||||
*/
|
||||
public function run()
|
||||
public function run(StatusRepositoryInterface $statusRepository)
|
||||
{
|
||||
//
|
||||
// System statuses
|
||||
$systemStatuses = [
|
||||
[
|
||||
'name' => 'Approved',
|
||||
'slug' => 'approved',
|
||||
],
|
||||
[
|
||||
'name' => 'Declined',
|
||||
'slug' => 'declined',
|
||||
],
|
||||
[
|
||||
'name' => 'Passive',
|
||||
'slug' => 'passive',
|
||||
],
|
||||
[
|
||||
'name' => 'Pending User',
|
||||
'slug' => 'pending_user',
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($systemStatuses as $status) {
|
||||
if (!$statusRepository->findBy('slug', $status['slug'])) {
|
||||
$statusRepository->create([
|
||||
'name' => $status['name'],
|
||||
'slug' => $status['slug'],
|
||||
'is_system' => true,
|
||||
'user_access' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user