PHP code example of provision / searchable

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

    

provision / searchable example snippets


'mysql' => [
...
    'strict' => false,
...
]

class Contact extends Model
{
    use \ProVision\Searchable\Traits\SearchableRelationTrait;

     /**
     * @return MorphTo
     */
    public function contactable()
    {
        return $this->morphTo();
    }

    /**
     * @inheritDoc
     */
    static function getSearchableRelationName(): string
    {
        return 'contactable';
    }
}