Categories
Categories package for Laravel Enso.
This package cannot work independently of the Enso ecosystem.
For live examples and demos, you may visit laravel-enso.com
Installation
- install the package using composer:
composer require laravel-enso/categories - install the front-end ui package using yarn:
yarn add @enso-ui/categories - adds the following alias in
client/vue.config.js
configureWebpack: {
resolve: {
alias: {
//other aliases
'@categories': `${__dirname}/node_modules/@enso-ui/categories/src/bulma`,
},
},
- in
client/js/router.jsfile, verify thatRouteMergeris imported, or import it
import RouteMerger from '@core-modules/importers/RouteMerger';
- make sure
routeImporteris also imported
import routeImporter from '@core-modules/importers/routeImporter';
- then use
RouteMergerto import front-end assets using the alias defined invue.config.js
(new RouteMerger(routes))
//other routes
.add(routeImporter(require.context('./routes', false, /.*\.js$/)))
.add(routeImporter(require.context('@categories/routes', false, /.*\.js$/)));
- in
resources/js/app.jsimport the package's icons
import '@categories/icons';
make sure
hot module replacementis not active, and runyarn devornpm run devrun
php artisan migrateto create table, add menu, permissions etc.
Features
- features a core categories functionality with a model, migrations, routes, controllers, resources, index table, etc
- provides CRUD functionality for the
Categorymodel - defines the relationships with a parent category as well as multiple child categories
- a
CategoryFactoryis included and can be published - the
Categorymodel also supports dynamic methods
Usage
The package is meant to be installed on an Enso project and customized as required (or used as it is if that is enough).
Note that this package is a dependency of the products Enso package.
Publishes
php artisan vendor:publish --tag=categories-factories- the included category factory,
Contributions
are welcome. Pull requests are great, but issues are good too.
License
This package is released under the MIT license.