Laravel adapter for the Aalberts PXL CMS
Nothing to see here for now. See the PXLCMS adapter package for more information.
$ composer require czim/aalberts-pxlcms
Add this line of code to the providers array located in your
And add the facade aliases to the same file:
'Aalberts' => Aalberts\Facades\AalbertsFacade::class, 'Translate' => Aalberts\Facades\TranslateFacade::class,
Publish the configuration:
$ php artisan vendor:publish
Set up event listening for missing translation phrases. Add the following pair to your
\Aalberts\Events\DetectedMissingTranslationPhrase::class => [ \Aalberts\Listeners\MissingTranslationPhraseListener::class ], \Aalberts\Events\SearchPerformed::class => [ \Aalberts\Listeners\SearchListener::class ],
This package requires that a cache driver be used that supports tagging (such as Redis).
Set the following keys for your application in the
.env file like so (or adjust
Translations, CMS content and Compano content are all cached for common lookups. All translations should be loaded in cache at all times; other content may be cached on demand.
A typical schedule for this in your
$schedule->command('aalberts:cache:translations')->everyFiveMinutes(); $schedule->command('aalberts:cache:cms:check')->everyTenMinutes(); $schedule->command('aalberts:cache:cmp:check')->dailyAt('06:00');
It is much more efficient to keep all translations cached, to prevent lookups for individual
Translations are not automatically cached, at least not in a batch.
To make sure the cache stays up to date, schedule the
artisan:cache:translations command to run periodically.
It is recommended to keep the interval at least 5 minutes or to prevent overlap.
The command will check whether a cache is required by comparing the latest
modifiedts date for all the organization's translations.
If no updates since the last cache time are detected, the cache will not be renewed.
If no cache has been set at all, this command will always fill the cache.
aalberts translations files for all locales that your application uses and set content like the following:
<?php return [ 'months' => [ '01' => 'jan', '02' => 'feb', '03' => 'mrt', '04' => 'apr', '05' => 'mei', '06' => 'jun', '07' => 'jul', '08' => 'aug', '09' => 'sep', '10' => 'okt', '11' => 'nov', '12' => 'dec', ], ];
This will be used by the
Run the generator to make the models and repositories:
$ php artisan aalberts:generate
This command works exactly like the
Some models have presenters from the Laracasts presenter package.
ToDo: add support for this to the package
- How to override and/or set your own presenter classes.
- Provide default presenters
- Set up date formatting (with 'special' standard class)
Note that the
Translator expects the generated Phrase and Translation classes to be in
Anywhere else will break the built-in
Things to update:
- Add the filter slugs & validation rules to the
Aalberts\Filters\ProductFilterData(don't forget the
- Add the filter slugs to the
- Add an
- Add an
- If it doesn't exist yet, add a repository for the Compano filter target model (such as for
- Update the
Aalberts\Factories\FilterStrategyFactory: set the repository for the slug
The MIT License (MIT). Please see License File for more information.