Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

morph laravel without classes name

// app/config/app.php or anywhere you like
'aliases' => [
    ...
    'MorphOrder' => 'SomeNamespaceOrder',
    'MorphStaff' => 'MaybeAnotherNamespaceStaff',
    ...
]

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

// Order model
protected $morphClass = 'MorphOrder';
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #morph #laravel #classes
ADD COMMENT
Topic
Name
5+4 =