PHP code example of ensinio / nova-inline-relationship
1. Go to this page and download the library: Download ensinio/nova-inline-relationship 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/ */
ensinio / nova-inline-relationship 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(),
];
}
}
namespace App\Nova\ThirdPartyIntegrations;
use KirschbaumDevelopment\NovaInlineRelationship\Integrations\ThirdParty;
use KirschbaumDevelopment\NovaInlineRelationship\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
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.