PHP code example of sfneal / builders

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

    

sfneal / builders example snippets

 php
use Illuminate\Database\Eloquent\Builder;
use Sfneal\Builders\QueryBuilder;

class ExampleModel extends Model
{
    /**
     * Query Builder.
     *
     * @param $query
     * @return QueryBuilder
     */
    public function newEloquentBuilder($query)
    {
        return new QueryBuilder($query);
    }
    
    /**
     * Query Builder method for improved type hinting.
     *
     * @return QueryBuilder|Builder
     */
    public static function query()
    {
        return parent::query();
    }
}