Folder Structure:
app
|-Admin.php
|-Admin
|
|-Product.php
Admin.php
--------------------------------------------------------
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
class Admin extends Authenticatable
{
public function erp()
{
return $this->belongsToMany(Admin\Product::class);
}
}
-----------------------------------------------------------
Product.php
-----------------------------------------------------------
namespace App\Admin;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
protected $primaryKey = 'productcode';
public $incrementing = false;
public function updatedBy()
{
return $this->belongsTo(Admin::class);
}
}
-----------------------------------------------------------
But got an error Class 'Admin::class' not found any solution??