PHP code example of gigerit / laravel-morphmap-js-generator
1. Go to this page and download the library: Download gigerit/laravel-morphmap-js-generator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gigerit / laravel-morphmap-js-generator example snippets
// App/Providers/AppServiceProvider.php
use Illuminate\Database\Eloquent\Relations\Relation;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
Relation::morphMap([
'tenant' => Tenant::class,
'user' => User::class,
1 => Client::class,
2 => Contact::class,
]);
}
}