indianracingcommunity / RLIProject

IRC Website
MIT License
7 stars 2 forks source link

Upgrade Laravel #157

Open kapilace6 opened 2 years ago

kapilace6 commented 2 years ago

https://github.com/indianracingcommunity/RLIProject/pull/80

kapilace6 commented 1 year ago

Upgrade to Laravel 7

kapilace6 commented 1 year ago

Upgrade to Laravel 8

kapilace6 commented 6 months ago

New factories helper class for Laravel 8+ factories. Consider creating an abstract class ModelFactory to be extended by all Factories:

<?php

namespace Database\Factories;

use Closure;
use Illuminate\Support\Collection;
use Illuminate\Database\Eloquent\Factories\Factory;

abstract class ModelFactory extends Factory
{
    protected function getAttributes()
    {
        return $this->states->pipe(function ($states) {
            return $this->for->isEmpty() ? $states : new Collection(array_merge([function () {
                return $this->parentResolvers();
            }], $states->all()));
        })->reduce(function ($carry, $state) {
            if ($state instanceof Closure) {
                $state = $state->bindTo($this);
            }
            return array_merge($carry, $state($carry));
        }, []);
    }
}
kapilace6 commented 6 months ago

Upgrade to Laravel 9