skip to Main Content

I have a model TestDirectory in laravel and test-directory table in mysql. After i manually importing a CSV file in to the mysql table via phpmyadmin, calling TestDirectory::all() is not fetching any data. But previously it was working fine.

Any direction please.

2

Answers


  1. Add to your model:

    protected $table = 'your_table';
    
    Login or Signup to reply.
  2. You should try fillable property on model

    protected $fillable = [
        'colume_name',
        'colume_name2'
    ];
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search