diff --git a/app/Events/DietSelected.php b/app/Events/DietSelected.php index 92e1c13..24965aa 100644 --- a/app/Events/DietSelected.php +++ b/app/Events/DietSelected.php @@ -12,9 +12,9 @@ class DietSelected { use Dispatchable, InteractsWithSockets, SerializesModels; - public $diet; + public Diet $diet; - public $user; + public User $user; /** * Create a new event instance. diff --git a/app/Listeners/ProcessDietSelectedNotification.php b/app/Listeners/ProcessDietSelectedNotification.php index daf5418..0473820 100644 --- a/app/Listeners/ProcessDietSelectedNotification.php +++ b/app/Listeners/ProcessDietSelectedNotification.php @@ -12,14 +12,9 @@ class ProcessDietSelectedNotification implements ShouldQueue { use InteractsWithQueue; - public $afterCommit = true; + public bool $afterCommit = true; - /** - * Handle the event. - * - * @return void - */ - public function handle(DietSelected $event) + public function handle(DietSelected $event): void { $user = $event->user; $diet = $event->diet; diff --git a/app/Livewire/Diet/Comment/Create.php b/app/Livewire/Diet/Comment/Create.php index 8d12ba9..f02784b 100644 --- a/app/Livewire/Diet/Comment/Create.php +++ b/app/Livewire/Diet/Comment/Create.php @@ -5,6 +5,7 @@ namespace App\Livewire\Diet\Comment; use App\Models\Diet; use App\Models\DietComment; use App\Models\User; +use Illuminate\View\View; use Livewire\Component; class Create extends Component @@ -13,23 +14,23 @@ class Create extends Component public User $user; - public $body = ''; + public string $body = ''; - public $grade = 0; + public string|int $grade = 0; - public $isChecked = true; + public bool $isChecked = true; - public function render() + public function render(): View { return view('livewire.diet.comment.create'); } - public function toggle() + public function toggle(): void { $this->isChecked ? false : true; } - public function save() + public function save(): void { $this->toggle(); $comment = new DietComment(); diff --git a/app/Livewire/Diet/Comment/Show.php b/app/Livewire/Diet/Comment/Show.php index efde860..17e6e6e 100644 --- a/app/Livewire/Diet/Comment/Show.php +++ b/app/Livewire/Diet/Comment/Show.php @@ -3,16 +3,20 @@ namespace App\Livewire\Diet\Comment; use App\Models\Diet; +use Illuminate\View\View; use Livewire\Component; class Show extends Component { public Diet $diet; - protected $listeners = ['commentAdded' => '$refresh']; - - public function render() + public function render(): View { return view('livewire.diet.comment.show'); } + + protected function getListeners(): array + { + return ['commentAdded' => '$refresh']; + } } diff --git a/app/Livewire/Diet/Comment/Upvote.php b/app/Livewire/Diet/Comment/Upvote.php index f314d97..6128a44 100644 --- a/app/Livewire/Diet/Comment/Upvote.php +++ b/app/Livewire/Diet/Comment/Upvote.php @@ -3,18 +3,19 @@ namespace App\Livewire\Diet\Comment; use App\Models\DietComment; +use Illuminate\View\View; use Livewire\Component; class Upvote extends Component { public DietComment $comment; - public function mount(DietComment $comment) + public function mount(DietComment $comment): void { $this->comment = $comment; } - public function render() + public function render(): View { $upvotes = $this->comment->upvotes()->forDietCommentsUpVote($this->comment)->count(); $downvotes = $this->comment->upvotes()->forDietCommentsDownVote($this->comment)->count(); @@ -30,7 +31,7 @@ class Upvote extends Component ); } - public function upvote() + public function upvote(): void { if ($this->comment->isUpVoted()) { $this->comment->removeUpVote(); @@ -49,7 +50,7 @@ class Upvote extends Component ]); } - public function downvote() + public function downvote(): void { if ($this->comment->isDownVoted()) { $this->comment->removeDownVote(); diff --git a/app/Livewire/Diet/Create.php b/app/Livewire/Diet/Create.php index b9426a1..2b624e7 100644 --- a/app/Livewire/Diet/Create.php +++ b/app/Livewire/Diet/Create.php @@ -3,7 +3,9 @@ namespace App\Livewire\Diet; use App\Models\Diet; +use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Auth; +use Illuminate\View\View; use Livewire\Component; use Livewire\WithFileUploads; @@ -11,43 +13,41 @@ class Create extends Component { use WithFileUploads; - public $name = ''; + public string $name = ''; - public $image; + public UploadedFile|null $image = null; - public $duration = '7'; + public int|string $duration = '7'; - public $state = 'draft'; + public string $state = 'draft'; - public $type = []; + public array $type = []; - public $details = ''; + public string $details = ''; - public $days = []; + public array $days = []; - public $copyedDay; + public string $copyedDay; - public $copyedDayData; + public array $copyedDayData; - protected $listeners = ['dayUpdated', 'makeCopy', 'makePaste']; - - public function render() + public function render(): View { return view('livewire.diet.create'); } - public function dayUpdated($dayIndex, $data) + public function dayUpdated(string $dayIndex, array $data): void { $this->days[$dayIndex] = $data; } - public function showPreview() + public function showPreview(): void { $this->state = 'draft'; $this->publish(); } - public function addToDrafts() + public function addToDrafts(): void { $this->state = 'draft'; $this->publish(); @@ -87,6 +87,11 @@ class Create extends Component // return redirect()->route('diet.show', $diet->id); } + protected function getListeners(): array + { + return ['dayUpdated', 'makeCopy', 'makePaste']; + } + protected function rules(): array { return [ diff --git a/app/Livewire/Diet/DayEdit.php b/app/Livewire/Diet/DayEdit.php index 977337d..68830f6 100644 --- a/app/Livewire/Diet/DayEdit.php +++ b/app/Livewire/Diet/DayEdit.php @@ -2,38 +2,37 @@ namespace App\Livewire\Diet; +use Illuminate\View\View; use Livewire\Component; class DayEdit extends Component { - public $day; + public string $day; - public $eatingTypes = ['breakfast', 'dinner', 'supper', 'lunch', 'snacks']; + public array $eatingTypes = ['breakfast', 'dinner', 'supper', 'lunch', 'snacks']; - public $activeType = 'breakfast'; + public string $activeType = 'breakfast'; - public $portions = []; + public array $portions = []; - public $name = ''; + public string $name = ''; - public $quantity = 0; + public int $quantity = 0; - public $portion = 'gram'; + public string $portion = 'gram'; - protected $listeners = ['takePaste']; - - protected $rules = [ + protected array $rules = [ 'name' => 'required|min:3', 'quantity' => 'required|numeric|min:1', 'portion' => 'required|min:3', ]; - public function render() + public function render(): View { return view('livewire.diet.day-edit'); } - public function addPortion($type) + public function addPortion(string $type): void { $this->validate(); $newData = [ @@ -49,7 +48,7 @@ class DayEdit extends Component $this->dispatch('dayUpdated', dayIndex: $this->day, data: $this->portions); } - public function delete($uniq, $type) + public function delete(string $uniq, string $type): void { $newPortions = collect($this->portions[$type]) ->filter( @@ -61,7 +60,7 @@ class DayEdit extends Component $this->dispatch('dayUpdated', dayIndex: $this->day, data: $this->portions); } - public function edit($uniq, $type) + public function edit(string $uniq, string $type): void { $elemKey = collect($this->portions[$type]) ->search(function ($item) use ($uniq) { @@ -80,7 +79,7 @@ class DayEdit extends Component } } - public function takePaste($day, $data) + public function takePaste(string $day, array $data): void { if (intval($day) === intval($this->day)) { foreach ($data as $type => $props) { @@ -89,4 +88,9 @@ class DayEdit extends Component $this->dispatch('dayUpdated', dayIndex: $this->day, data: $this->portions); } } + + protected function getListeners(): array + { + return ['takePaste']; + } } diff --git a/app/Livewire/Diet/Edit.php b/app/Livewire/Diet/Edit.php index 386fc59..333c43f 100644 --- a/app/Livewire/Diet/Edit.php +++ b/app/Livewire/Diet/Edit.php @@ -2,7 +2,10 @@ namespace App\Livewire\Diet; -use App\Models\Diet; use Livewire\Component; +use App\Models\Diet; +use Illuminate\Http\UploadedFile; +use Illuminate\View\View; +use Livewire\Component; use Livewire\WithFileUploads; class Edit extends Component @@ -11,27 +14,25 @@ class Edit extends Component public Diet $diet; - public $name = ''; + public string $name = ''; - public $image; + public UploadedFile|string $image = ''; - public $duration = '7'; + public int|string $duration = '7'; - public $state = 'draft'; + public string $state = 'draft'; - public $type = []; + public array $type = []; - public $details = ''; + public string $details = ''; - public $days = []; + public array $days = []; - public $copyedDay; + public string $copyedDay; - public $copyedDayData; + public array $copyedDayData; - protected $listeners = ['dayUpdated', 'makeCopy', 'makePaste']; - - public function mount(Diet $diet) + public function mount(Diet $diet): void { $this->name = $diet->name; $this->image = $diet->image; @@ -42,35 +43,35 @@ class Edit extends Component $this->days = $diet->daily_schedule; } - public function render() + public function render(): View { return view('livewire.diet.edit'); } - public function dayUpdated($dayIndex, $data) + public function dayUpdated(string $dayIndex, array $data): void { $this->days[$dayIndex] = $data; } - public function showPreview() + public function showPreview(): void { $this->state = 'draft'; $this->publish(); } - public function addToDrafts() + public function addToDrafts(): void { $this->state = 'draft'; $this->publish(); } - public function makeCopy($day) + public function makeCopy(string $day): void { /* dd($day); */ $this->copyedDay = $day; } - public function makePaste($copyToDay) + public function makePaste(string $copyToDay): void { $data = $this->days[$this->copyedDay]; $this->dispatch( @@ -88,7 +89,7 @@ class Edit extends Component $diet->name = $this->name; /* $diet->image = $this->image->store('diets', 'public'); */ - $diet->image = ! is_string($this->image) ? $this->image->store('plans') : $this->image; + $diet->image = ! is_string($this->image) ? $this->image->store('diets') : $this->image; $diet->duration = $this->duration; $diet->state = $this->state; $diet->type = $this->type; @@ -102,7 +103,12 @@ class Edit extends Component /* $user->author_of_diets()->attach($diet->id); */ } - protected function rules() + protected function getListeners(): array + { + return ['dayUpdated', 'makeCopy', 'makePaste']; + } + + protected function rules(): array { return [ 'name' => 'required|min:3', diff --git a/app/Livewire/Diet/Like.php b/app/Livewire/Diet/Like.php index 499fe4d..018a852 100644 --- a/app/Livewire/Diet/Like.php +++ b/app/Livewire/Diet/Like.php @@ -3,20 +3,21 @@ namespace App\Livewire\Diet; use App\Models\Diet; +use Illuminate\View\View; use Livewire\Component; class Like extends Component { public Diet $diet; - public $isIconOnly = false; + public bool $isIconOnly = false; - public function mount(Diet $diet) + public function mount(Diet $diet): void { $this->diet = $diet; } - public function render() + public function render(): View { return view('livewire.diet.like'); } diff --git a/app/Livewire/Diet/StartButton.php b/app/Livewire/Diet/StartButton.php index dd807f5..4df50fa 100644 --- a/app/Livewire/Diet/StartButton.php +++ b/app/Livewire/Diet/StartButton.php @@ -5,6 +5,7 @@ namespace App\Livewire\Diet; use App\Events\DietSelected; use App\Models\Diet; use App\Models\User; +use Illuminate\View\View; use Livewire\Component; class StartButton extends Component @@ -13,19 +14,19 @@ class StartButton extends Component public User $user; - public $chosenDietState; + public string $chosenDietState; - public function mount() + public function mount(): void { $this->chosenDietState = data_get($this->user->chosen_diet, 'last_state', 'oops'); } - public function render() + public function render(): View { return view('livewire.diet.start-button'); } - public function start() + public function start(): void { DietSelected::dispatch( $this->diet, @@ -33,7 +34,7 @@ class StartButton extends Component ); } - public function getLastState() + public function getLastState(): void { $this->chosenDietState = data_get($this->user->chosen_diet, 'last_state', 'oops'); } diff --git a/app/Models/BlogPostLike.php b/app/Models/BlogPostLike.php index 829d3d0..121556e 100644 --- a/app/Models/BlogPostLike.php +++ b/app/Models/BlogPostLike.php @@ -2,9 +2,9 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Builder; /** * App\Models\BlogPostLike diff --git a/app/Models/ChosenDiet.php b/app/Models/ChosenDiet.php index 8de788f..6522260 100644 --- a/app/Models/ChosenDiet.php +++ b/app/Models/ChosenDiet.php @@ -5,6 +5,7 @@ namespace App\Models; use Iben\Statable\Statable; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; /** * App\Models\ChosenDiet @@ -46,27 +47,27 @@ class ChosenDiet extends Model 'start_date', ]; - public function getActorId() + public function getActorId(): int { return $this->user_id; } - public function user() + public function user(): BelongsTo { return $this->belongsTo(User::class); } - public function diet() + public function diet(): BelongsTo { return $this->belongsTo(Diet::class); } - protected function getGraph() + protected function getGraph(): string { return 'chosen_diet'; } - protected function saveBeforeTransition() + protected function saveBeforeTransition(): bool { return true; } diff --git a/app/Models/Diet.php b/app/Models/Diet.php index 0500147..cd745ec 100644 --- a/app/Models/Diet.php +++ b/app/Models/Diet.php @@ -4,11 +4,12 @@ namespace App\Models; use CyrildeWit\EloquentViewable\Contracts\Viewable; use CyrildeWit\EloquentViewable\InteractsWithViews; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; -use Illuminate\Database\Eloquent\Relations\HasMany; -use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Database\Eloquent\Relations\HasMany; /** * App\Models\Diet @@ -64,6 +65,18 @@ class Diet extends Model implements Viewable { use HasFactory, InteractsWithViews; + protected $casts = [ + 'type' => 'array', + 'daily_schedule' => 'array', + ]; + + private array $allowedDietTypes = [ + 'alko', + 'corb', + 'meat', + 'veg', + ]; + // protected $withCount = [ // 'likes', // 'comments', @@ -75,19 +88,7 @@ class Diet extends Model implements Viewable return self::withCount(['likes', 'comments', 'choses']); } - protected $casts = [ - 'type' => 'array', - 'daily_schedule' => 'array', - ]; - - private $allowedDietTypes = [ - 'alko', - 'corb', - 'meat', - 'veg', - ]; - - public function author() + public function author(): BelongsToMany { return $this ->belongsToMany(User::class, 'diet_author', 'diet_id', 'user_id'); @@ -100,7 +101,7 @@ class Diet extends Model implements Viewable );*/ } - public function comments() + public function comments(): HasMany { return $this->hasMany(DietComment::class); } @@ -110,7 +111,7 @@ class Diet extends Model implements Viewable return $this->hasMany(DietLike::class); } - public function isLiked(): bool + public function isLiked(): bool|int { if (auth()->user()) { return auth()->user()->diet_likes()->forDiet($this)->count(); @@ -119,7 +120,7 @@ class Diet extends Model implements Viewable return false; } - public function removeLike(): bool + public function removeLike(): bool|int { if (auth()->user()) { return auth()->user()->diet_likes()->forDiet($this)->delete(); @@ -133,7 +134,7 @@ class Diet extends Model implements Viewable $data = $this->type; return new Attribute( - get: fn() => array_keys($data), + get: fn () => array_keys($data), ); } @@ -142,36 +143,36 @@ class Diet extends Model implements Viewable $data = $this->daily_schedule; return new Attribute( - get: fn() => $data, + get: fn () => $data, ); } - public function choses() + public function choses(): HasMany { return $this->hasMany(ChosenDiet::class); } - public function scopeDurationMin(Builder $query, $days): Builder + public function scopeDurationMin(Builder $query, string $days): Builder { return $query->where('duration', '>=', $days); } - public function scopeDurationMax(Builder $query, $days): Builder + public function scopeDurationMax(Builder $query, string $days): Builder { return $query->where('duration', '<=', $days); } - public function scopeInvolvedMin(Builder $query, $number): Builder + public function scopeInvolvedMin(Builder $query, string $number): Builder { return $query->having('choses_count', '>=', $number); } - public function scopeInvolvedMax(Builder $query, $number): Builder + public function scopeInvolvedMax(Builder $query, string $number): Builder { return $query->having('choses_count', '<=', $number); } - public function scopeContainsType(Builder $query, $types): Builder + public function scopeContainsType(Builder $query, array $types): Builder { $i = 0; @@ -186,13 +187,4 @@ class Diet extends Model implements Viewable return $query; } - - // private function unserializeOptionsArr($str) - // { - // if (preg_match('/^".*"$/', $str)) { - // return stripslashes(mb_substr($str, 1, -1)), true; - // } - - // return json_decode(stripslashes($str), true); - // } } diff --git a/app/Models/DietComment.php b/app/Models/DietComment.php index defb14d..e0c3e3f 100644 --- a/app/Models/DietComment.php +++ b/app/Models/DietComment.php @@ -4,6 +4,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; /** @@ -39,12 +40,12 @@ class DietComment extends Model { use HasFactory; - public function author() + public function author(): BelongsTo { return $this->belongsTo(User::class, 'user_id'); } - public function diet() + public function diet(): BelongsTo { return $this->belongsTo(Diet::class, 'diet_id'); } @@ -54,7 +55,7 @@ class DietComment extends Model return $this->hasMany(DietCommentUpvote::class, 'comment_id'); } - public function isUpVoted(): bool + public function isUpVoted(): bool|int { if (auth()->user()) { return auth() @@ -67,7 +68,7 @@ class DietComment extends Model return false; } - public function isDownVoted(): bool + public function isDownVoted(): bool|int { if (auth()->user()) { return auth() @@ -80,7 +81,7 @@ class DietComment extends Model return false; } - public function removeUpVote(): bool + public function removeUpVote(): bool|int { if (auth()->user()) { return auth() diff --git a/app/Models/DietCommentUpvote.php b/app/Models/DietCommentUpvote.php index e2ec669..09edda7 100644 --- a/app/Models/DietCommentUpvote.php +++ b/app/Models/DietCommentUpvote.php @@ -2,8 +2,10 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; /** * App\Models\DietCommentUpvote @@ -42,22 +44,22 @@ class DietCommentUpvote extends Model 'type', ]; - public function author() + public function author(): BelongsTo { return $this->belongsTo(User::class, 'user_id'); } - public function diet_comment() + public function diet_comment(): BelongsTo { return $this->belongsTo(DietComment::class, 'comment_id'); } - public function scopeForDietCommentsUpVote($query, DietComment $comment) + public function scopeForDietCommentsUpVote(Builder $query, DietComment $comment): Builder { return $query->where('comment_id', $comment->id)->where('type', 'upvote'); } - public function scopeForDietCommentsDownVote($query, DietComment $comment) + public function scopeForDietCommentsDownVote(Builder $query, DietComment $comment): Builder { return $query->where('comment_id', $comment->id)->where('type', 'downvote'); } diff --git a/app/Models/DietLike.php b/app/Models/DietLike.php index ec15270..d856e23 100644 --- a/app/Models/DietLike.php +++ b/app/Models/DietLike.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -34,7 +35,7 @@ class DietLike extends Model 'user_id', ]; - public function scopeForDiet($query, Diet $diet) + public function scopeForDiet(Builder $query, Diet $diet): Builder { return $query->where('diet_id', $diet->id); } diff --git a/app/Notifications/DietStarted.php b/app/Notifications/DietStarted.php index 7a46d24..7ed5c85 100644 --- a/app/Notifications/DietStarted.php +++ b/app/Notifications/DietStarted.php @@ -11,39 +11,23 @@ class DietStarted extends Notification implements ShouldQueue { use Queueable; - public $chosenDiet; + public object $chosenDiet; /** * Create a new notification instance. - * - * @return void */ - public function __construct($chosenDiet) + public function __construct(object $chosenDiet) { $this->afterCommit(); $this->chosenDiet = $chosenDiet; } - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * - * @return array - */ - public function via($notifiable) + public function via(object $notifiable): array { return ['mail']; } - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) + public function toMail(object $notifiable): MailMessage { return (new MailMessage()) ->line('you are successful started diet named: '.$this->chosenDiet->diet->name) @@ -51,14 +35,7 @@ class DietStarted extends Notification implements ShouldQueue ->line('Thank you for using our application!'); } - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * - * @return array - */ - public function toArray($notifiable) + public function toArray(object $notifiable): array { return [ diff --git a/database/factories/DietFactory.php b/database/factories/DietFactory.php index d4917be..d347845 100644 --- a/database/factories/DietFactory.php +++ b/database/factories/DietFactory.php @@ -2,20 +2,18 @@ namespace Database\Factories; -use Illuminate\Database\Eloquent\Factories\Factory; use FakerRestaurant\Provider\en_US\Restaurant; -use App\Models\Diet; -use App\Models\User; -use Illuminate\Http\UploadedFile; -use Illuminate\Support\Facades\Storage; +use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Http\File; +use Illuminate\Support\Facades\Storage; +use Faker\Generator; /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Diet> + * @property Generator|Restaurant $faker */ class DietFactory extends Factory { - /** * Define the model's default state. * @@ -26,13 +24,13 @@ class DietFactory extends Factory $faker = \Faker\Factory::create(); $this->faker->addProvider(new Restaurant($faker)); $dietDuration = $this->faker->randomElement([7, 14, 21]); - $dietState = $this->faker->randomElement(['active','draft','archived']); + $dietState = $this->faker->randomElement(['active', 'draft', 'archived']); $numberOfDefinedDietTypes = $this->faker->numberBetween(1, 4); - $expectedDietTypes = ['meat', 'veg', 'corb', 'alko']; + $expectedDietTypes = ['meat', 'veg', 'corb', 'alko']; $selectedDietTypes = $this->faker->randomElements($expectedDietTypes, $numberOfDefinedDietTypes); $dietTypes = array_reduce( $selectedDietTypes, - function($acc, $el) { + function ($acc, $el) { $acc[$el] = true; return $acc; }, @@ -47,12 +45,11 @@ class DietFactory extends Factory $file = new File($imageFilePath); $fileLocalPath = Storage::putFile('diets', $file, 'public'); - for($day = 1; $day <= $dietDuration ; $day++) { - foreach($dietEatingTypes as $eatingType) { - + for ($day = 1; $day <= $dietDuration; $day++) { + foreach ($dietEatingTypes as $eatingType) { $numberOfProductsInCurrentMeel = $this->faker->numberBetween(1, 4); - for(;$numberOfProductsInCurrentMeel > 0; $numberOfProductsInCurrentMeel--) { + for (; $numberOfProductsInCurrentMeel > 0; $numberOfProductsInCurrentMeel--) { $meelName = $this->faker->foodName(); $dailySchedule[$day][$eatingType][] = [ 'name' => $meelName, @@ -77,7 +74,7 @@ class DietFactory extends Factory $dietNamePrefix = $this->faker->randomElement(['Super', 'Keto', 'Fast', 'Detox', 'Power Of', 'Green', 'Healthy', 'Turbo']); return [ - 'name' => $dietNamePrefix . " " . $dietName . " Diet", + 'name' => $dietNamePrefix . ' ' . $dietName . ' Diet', 'duration' => $dietDuration, 'state' => $dietState, 'image' => $fileLocalPath,