area17 / blast

Storybook for Laravel Blade 🚀
https://dev.to/area17/getting-started-with-blast-storybook-for-laravel-blade-c5c
Apache License 2.0
268 stars 39 forks source link

Create DataStore facade #37

Open ptrckvzn opened 2 years ago

ptrckvzn commented 2 years ago

This PR creates a Facade DataStore. I changed the way the data sore loads its content. Instead of loading all files in data/*.php on init, it will try to load each file as they are requested, in order to be able to use the data store from within data files and prevent recursive loads.

The change to the data store should be optimized a bit further.

<?php

use A17\Blast\Facades\DataStore;

$tag = DataStore::get('tag.base');

return [
    'artwork' => [