I have several 4 tables Starting with Users - > Departments - > category_department - > category - > postings; Where the department_category table it serves as pivo for many to many relationship between the departments table and the category table.
These are the last 4 tables.
When I enter the Category model and having to do a belongsToMany in the Department model appears a FatalThrowableError saying that my class has been found (Class 'Department: class' not found) I'm doing this in the Category.php template:
public function departamentos()
{
return $this->belongsToMany('Departamento::class', 'categoria_departamento');
}
And in the Departments model I did so see:
public function categorias()
{
return $this->belongsToMany('Categoria::class' , 'categoria_departamento');
}
I really do not know why you are giving this error. What am I doing wrong?