stijlgenoten / data-collection
Superlight static DataCollection package for Laravel
Installs: 837
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 2
pkg:composer/stijlgenoten/data-collection
This package is auto-updated.
Last update: 2025-12-05 01:46:24 UTC
README
This package ensures that, for example, static data such as a country list are available everywhere in your laravel application with useful functions, see it as an static data resource without using any DB.
Install
composer require stijlgenoten/data-collection
Use
Run this command to make a data collection
php artisan make:datacollection {Name}
The package will automatically generate a file ( in folder App\DataCollections ) looking like this:
<?php namespace App\DataCollections; use Stijlgenoten\DataCollection\DataCollection; class DummyCollection extends DataCollection { public static function RegisterData() { return []; } }
Within the RegisterData() function you can for store an array, some examples:
return ['red','white','blue'];
return [ 'NL' => 'Nederland', 'XX' => 'Xxxxxx', ];