Skip to content

[Feature]: Features request. #895

@djdony

Description

@djdony

Hi, I like the generation of code, but have some opinions. Correct me if something wrong.

  1. Requests:
    Scaffolding creating 2 separate files for Update and Create in Model.
    There is no difference as i see. My advice to make one request file. For update rules i write something like.
    public function rules() {
        $rules = [
            'name' => 'required|unique:cars',
            'car_type_id' => 'required',
            'max_pax' => 'required',
        ];
        if ($this->route('car')){
            $rules['name'] = [
                'required',
                Rule::unique('cars')->ignore($this->route('car'))];
        }
        return $rules;

    }

And i delete rules from model and write logic in request itself.

  1. BaseRepository.
    Did not find anything related with eager loading. added code. I think it is used mostly.
    // Get with eager loading
    public function with($with)
    {
        $query = $this->model->newQuery()->with($with);

        return $query->get();
    }
  1. Generating blade templates:
    There are too much code repeat in some blades(create,edit,show)
    Better to make create_layout, edit_layout etc and pass params from some json file?

Anyway thank you for great package and your effort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions