composed project, added packages, models, controllers, seeders, mirgations etc.

This commit is contained in:
2024-07-28 17:45:09 +03:00
parent 5d05ee373a
commit 56eec65355
73 changed files with 3576 additions and 368 deletions

View File

@@ -0,0 +1,70 @@
<?php
/**
* @package: events-venues-task
* @author: Yevhen Odynets
* @date: 2024-07-26
* @time: 19:20
*/
//phpcs:ignore
declare(strict_types = 1);
namespace App\Services\Faker\Image;
use Illuminate\Support\Arr;
class ImageStorage
{
private string $destFolder;
private int $width;
private int $height;
private array $keywords;
public function __construct(string $destFolder, int $width, int $height, array $keywords = [])
{
$this->destFolder = $destFolder;
$this->width = $width;
$this->height = $height;
$this->keywords = $keywords;
}
/**
* @return string
*/
public function getFolder(): string
{
return $this->destFolder;
}
/**
* @return int
*/
public function getWidth(): int
{
return $this->width;
}
/**
* @return int
*/
public function getHeight(): int
{
return $this->height;
}
/**
* @param string $prefix
* @param string $suffix
*
* @return string|null
*/
public function getKeyword(string $prefix = '', string $suffix = ''): ?string
{
if (count($this->keywords) === 0) {
return null;
}
return $prefix . Arr::random($this->keywords) . $suffix;
}
}