📜  没有类名的 morph laravel - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:11.480000             🧑  作者: Mango

代码示例1
// app/config/app.php or anywhere you like
'aliases' => [
    ...
    'MorphOrder' => 'Some\Namespace\Order',
    'MorphStaff' => 'Maybe\Another\Namespace\Staff',
    ...
]

// Staff model
protected $morphClass = 'MorphStaff';

// Order model
protected $morphClass = 'MorphOrder';