-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
|
||
namespace Cone\Root\Database\Seeders; | ||
|
||
use Cone\Root\Jobs\MoveFile; | ||
use Cone\Root\Jobs\PerformConversions; | ||
use Cone\Root\Models\Medium; | ||
use Cone\Root\Models\User; | ||
use Illuminate\Database\Seeder; | ||
|
||
|
@@ -13,10 +16,39 @@ class RootTestDataSeeder extends Seeder | |
* @return void | ||
*/ | ||
public function run(): void | ||
{ | ||
$this->seedUsers(); | ||
$this->seedMedia(); | ||
} | ||
|
||
/** | ||
* Seed the user models. | ||
* | ||
* @return void | ||
*/ | ||
protected function seedUsers(): void | ||
{ | ||
User::factory()->create([ | ||
'name' => 'Root Admin', | ||
'email' => '[email protected]', | ||
]); | ||
} | ||
|
||
/** | ||
* Seed the media models. | ||
* | ||
* @return void | ||
*/ | ||
protected function seedMedia(): void | ||
{ | ||
$path = __DIR__.'/../../stubs/placeholder.png'; | ||
|
||
foreach (range(1, 10) as $key) { | ||
$medium = Medium::createFrom($path); | ||
|
||
MoveFile::withChain([ | ||
new PerformConversions($medium), | ||
])->dispatch($medium, $path); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.