PHP code example of artwinpro / laravel-search

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

    

artwinpro / laravel-search example snippets



use Artwinpro\LaravelSearch\SearchTrait;
 
class Posts extends Model
{
    use SearchTrait;
    
    // Searchable fields.
    public $searchable =  ['name', 'email', 'phone'];
}
 

 $posts = Posts::search()->get(); // Get searched posts from the database.
 

 /?name=Admin&[email protected]&phone=+37063028205