Voyager: cant create relations

Created on 24 Sep 2017  路  11Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.5
  • Voyager Version: 1.0.2
  • PHP Version: 7.1

Description:

Cant create relation "Belongs To" receiving error:

Model Class does not exist. Please create Model before creating relationship.

"Has One", "Has Many", "Belongs To Many" also failing to create

Models are generated (made via "create new table"), but they are empty:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;


class vehicles extends Model
{

}

Most helpful comment

Guys, English please... Nobody else will be able to jump in to help if you speak other languages

Also, @kolep8's issue was closed. Please consider opening your own or discussing on our Slack group instead.

All 11 comments

If that code is the full model that it generated then it looks like the problem is that the Model class wasn't imported. Try adding the following above the class declaration.

use Illuminate\Database\Eloquent\Model;
  • Laravel Version: 5.5
  • Voyager Version: 1.0.4
  • PHP Version: 7.1

Hi,

I have same issue with @kolep8 , use generated models too (model class was imported) and i also trying to use models from make model command, but it still showing the "Model class not exist" error.

Any solution for this?

Thanks.

Hi Andhika, boleh lihat script modelnya ?

@kolep is your model name you generated as same as with what you typed on BREAD editor ? AppVehicle or AppVehicles ?
I see you your model name used plural and lowercase. cmiiw

Halo mas @jambari , ini script model kosongan yg di-generate:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class JudgeCategory extends Model
{
    //
}

Dan pas di pop-up relationship, harusnya kan muncul field list untuk dipilih, tp ini cuma angka2 gitu:
screen shot 2017-09-29 at 15 36 38

Thanks.

itu diganti AppJudgeCategory bukan App/JudgeCategory

Ini udah bs create relationship, tp masih error yg di bagian display & store field list-nya:
screen shot 2017-09-29 at 17 19 56

Apa tidak seharusnya JudgeCategory yang belongs to Judge ?

Guys, English please... Nobody else will be able to jump in to help if you speak other languages

Also, @kolep8's issue was closed. Please consider opening your own or discussing on our Slack group instead.

I got the same problem , and still don t know what is the solution . If someone could make it clear , i d be grateful .

The solution is to open your own issue or ask in our Slack group. This issue has been closed for nearly 9 months now, and was for a significantly older release.

Was this page helpful?
0 / 5 - 0 ratings