PHP code example of keko94 / nova-inline-relationship-extended

1. Go to this page and download the library: Download keko94/nova-inline-relationship-extended 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/ */

    

keko94 / nova-inline-relationship-extended example snippets


namespace App\Nova;

use Laravel\Nova\Fields\Image;

class BlogPost extends Resource
{
    //...
    public function fields(Request $request)
    {
        return [
            //...

            HasMany::make('Images', 'images', Image::class)->inline(),
        ];
    }
}

HasMany::make('Images')->inline()->sortUsing('order'),

HasOne::make('Profile', 'profile', Profile::class)->inline()->

'third-party' => [
    'App\Nova\ThirdPartyIntegrations',
    'Keko94\NovaInlineRelationshipExtended\Integrations',
]



namespace App\Nova\ThirdPartyIntegrations;

use Keko94\NovaInlineRelationshipExtended\Integrations\ThirdParty;
use Keko94\NovaInlineRelationshipExtended\Integrations\Contracts\ThirdPartyContract;

class SomeThirdPartyField extends ThirdParty implements ThirdPartyContract
{
    /**
     * Fields array from object.
     *
     * @return array
     */
    public function fields(): array
    {
        // The following is just an example and should be updated to meet your needs.
        return $this->field->customFieldArray;
    }
}
shell script
php artisan vendor:publish