PHP code example of crucialdigital / metamorph

1. Go to this page and download the library: Download crucialdigital/metamorph 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/ */

    

crucialdigital / metamorph example snippets


// config/metamorph.php
[
    ....
    'repositories' => [
         'post' => \App\Repositories\PostRepository::class,
         'user' => \App\Repositories\UserRepository::class
    ],
    'models' => [
         'post' => \App\Models\Post::class,
         'user' => \App\Models\User::class
    ]
    ...
]
bash
php artisan vendor:publish --tag="metamorph-config"
bash
php artisan metamorph:make-model Post -R
xpath 
app/Models/Post.php
bash
php artisan make:model Post
xpath
app/Repositories/PostRepositories.php
bash
php artisan metamorph:make-repository PostRepository --model=Post
bash
php artisan metamorph:models

//config/metamorph.php
...
'middlewares' => ['auth:sanctum', 'verified'],
...