PHP code example of afea / filament-testimonials

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

    

afea / filament-testimonials example snippets


->plugin(\Afea\Cms\Testimonials\Filament\TestimonialsPlugin::make())

use Afea\Cms\Testimonials\Models\Testimonial;

$quotes = Testimonial::query()->active()->ordered()->get();

$videoQuotes = Testimonial::query()
    ->active()
    ->ordered()
    ->get()
    ->filter(fn (Testimonial $t) => $t->hasVideo());

class Testimonial extends \Afea\Cms\Testimonials\Models\Testimonial
{
    public function scopeFeatured($q)
    {
        return $q->active()->where('order', '<=', 3);
    }
}

'models' => ['testimonial' => \App\Models\Testimonial::class],