This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\DataTables\Scopes; | |
| //use Debugbar; | |
| use Yajra\DataTables\Contracts\DataTableScope; | |
| //use App\Models\Concerns\SearchBuilder; | |
| class SearchBuilderScope implements DataTableScope |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Models\Concerns; | |
| trait SearchBuilder | |
| { | |
| public function scopeSearchBuilder($query) | |
| { | |
| if (request()->filled('searchBuilder') && request()->query('searchBuilder') !== 'false') { | |
| $query->where(function ($query) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App; | |
| use Illuminate\Http\Request; | |
| /** | |
| * Depth 1 SearchBuilder for DataTable | |
| * Supports Query Builder and Eloquent ORM | |
| * To prevent unauthorized access to the database, the code uses two security measures. |