PHP code example of websight / l5-polyfaq

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

    

websight / l5-polyfaq example snippets


composer 

Websight\Polyfaq\PolyfaqServiceProvider::class,


use Websight\Polyfaq\FaqTrait;

class MyModel extends Model {

    use FaqTrait;
    
}

class MyModel extends Model {

    /**
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany
     */
    public function coolfaqs()
    {
        return $this->morphMany('Websight\Polyfaq\Faq', 'faqable');
    }

}

php artisan vendor:publish --provider="Websight\Polyfaq\PolyfaqServiceProvider" --tag="config"

php artisan vendor:publish --provider="Websight\Polyfaq\PolyfaqServiceProvider" --tag="migrations"

php artisan migrate

php artisan vendor:publish --provider="Websight\Polyfaq\PolyfaqServiceProvider" --tag="translations"