An example package to enrich CMS page entity with new attributes.
-
Create
packages/Magentix/CmsCustomdirectory -
Copy the repository files into this new directory (
packages/Magentix/CmsCustom/src/*) -
Register the package in
composer.json
"autoload": {
...
"psr-4": {
// Other PSR-4 namespaces
"Magentix\\CmsCustom\\": "packages/Magentix/CmsCustom/src"
}
}- Register the package's service provider in the
config/app.phpfile
<?php
return [
// Other configuration options
'providers' => ServiceProvider::defaultProviders()->merge([
// Other service providers
Magentix\CmsCustom\Providers\EventServiceProvider::class,
])->toArray(),
// Other configuration options
];- Run the commands to execute migrations and clear the cache
php artisan migrate
php artisan optimize:clear