PHP code example of wqa / nova-page-flexible-models
1. Go to this page and download the library: Download wqa/nova-page-flexible-models 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/ */
wqa / nova-page-flexible-models example snippets
class AboutPage extends Template
{
use WQA\NovaPageFlexibleModels\HasFlexibleModels;
public function fields(Request $request)
{
return [
Panel::make('Tesimonials', [
$this->addFlexibleModelField('Testimonials', 'testimonials', Testimonial::class, 'author'),
])
];
}
public function testimonials(): Collection
{
return $this->getFlexibleModels('testimonials', Testimonial::class);
}
}