pdphilip / laravel-data-set
Eloquent style management of data sets in Laravel
Fund package maintenance!
PDPhilip
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^3
- pestphp/pest-plugin-arch: ^3
- pestphp/pest-plugin-laravel: ^3
- phpstan/extension-installer: ^1
- phpstan/phpstan-deprecation-rules: ^2
- phpstan/phpstan-phpunit: ^2
This package is auto-updated.
Last update: 2025-10-02 13:27:11 UTC
README
Laravel Data Set
Eloquent style management of data sets in Laravel
Installation
Add the package via composer:
composer require pdphilip/laravel-data-set
Usage
use PDPhilip\DataSet\DataSet; $dataSet = new DataSet; //Add data models $model = $dataSet->create(); $model->name = 'Alpha'; $model->status = 'active'; $model->hits = 2; $model->save(); $model2 = $dataSet->create(); $model2->name = 'Bravo'; $model2->status = 'active'; $model2->hits = 15; $model2->save(); $model3 = $dataSet->create(); $model3->name = 'Charlie'; $model3->status = 'inactive'; $model3->hits = 6; $model3->save(); $model4 = $dataSet->create(); $model4->name = 'Delta'; $model4->status = 'active'; $model4->hits = 11; $model4->save(); $dataSet->add([ $model4->name = 'Echo'; $model4->status = 'inactive'; $model4->hits = 5; ]); //Find $model = $dataSet->where('name','Charlie')->first() $models = $dataSet->where('status','active')->get() $models = $dataSet->where('hits','>',5)->get() $models = $dataSet->search('Delta')->get() ///..... //Count $count = $dataSet->where('hits','>',5)->count() //3
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.