Skip to content

Problems with models & fillable with '_' #9

@spooksie

Description

@spooksie

I tried to install and work with this package and it throws a lot of errors.

inside the model (services_relation.php)
protected $fillable = ['am_cat_id','service_category'];

Problem 1:
The template wont work as its trying to render

public function render()
    {
        $model = Model::where('am_cat_id', 'like', '%'.$this->search.'%')->orWhere('service_category', 'like', '%'.$this->search.'%')->latest()->paginate($this->paginate);
        return view('livewire.services-relation', [
            'rows'=> $model
        ]);
    }

Which I fixed with

public function render()
    {
        $model = Model::where('am_cat_id', 'like', '%'.$this->search.'%')->orWhere('service_category', 'like', '%'.$this->search.'%')->latest()->paginate($this->paginate);
        return view('livewire.services_relation', [
            'rows'=> $model
        ]);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions