mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -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;
|
<?php namespace Visiosoft\AdvsModule;
|
||||||
|
|
||||||
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
||||||
|
use Visiosoft\AdvsModule\Status\StatusSeeder;
|
||||||
|
|
||||||
class AdvsModuleSeeder extends Seeder
|
class AdvsModuleSeeder extends Seeder
|
||||||
{
|
{
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
|
$this->call(StatusSeeder::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,15 +1,41 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule\Status;
|
<?php namespace Visiosoft\AdvsModule\Status;
|
||||||
|
|
||||||
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
|
||||||
|
use Visiosoft\AdvsModule\Status\Contract\StatusRepositoryInterface;
|
||||||
|
|
||||||
class StatusSeeder extends Seeder
|
class StatusSeeder extends Seeder
|
||||||
{
|
{
|
||||||
|
public function run(StatusRepositoryInterface $statusRepository)
|
||||||
/**
|
|
||||||
* Run the seeder.
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
{
|
||||||
//
|
// 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