PHP code example of mirhamit / searchable

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

    

mirhamit / searchable example snippets


use MirHamit\Searchable\Searchable;

class User extends Authenticatable
{
    use HasApiTokens, HasFactory, Notifiable, Searchable;
...
}

Route::get('search', function () {
    return \App\Models\User::search('w1w', 0)->paginate(2);
    // return \App\Models\User::search($request->input(), 1)->paginate(2);
});