mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
24 lines
589 B
PHP
24 lines
589 B
PHP
<?php
|
|
|
|
namespace App\Grills;
|
|
|
|
use App\Grills\Grill;
|
|
use Faker\Factory;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class GrillFactory {
|
|
|
|
public static function getGrill() {
|
|
// Retrieve grills through Storage Facade [see config/filesystems.php]
|
|
$grill_disk = Storage::disk('grill');
|
|
$grills = $grill_disk->files();
|
|
|
|
// Retrieve a random grill with Faker
|
|
$faker = Factory::create();
|
|
$grill = $faker->randomElement($grills);
|
|
$grill_path = $grill_disk->url($grill);
|
|
|
|
// Return Grill
|
|
return new Grill($grill_path);
|
|
}
|
|
} |