The Laravel package to provide core functionalities of Laravel dashboard
Demo: https://core.laravue.dev
Laravue provides necessary Element UI and rich features for an enterprise admin dashboard, therefore it's highly recommended to use for starting a project. The following instructions are for intergrating core features of Laravue to existing Laravel project or to experiement with it.
composer require tuandm/laravue-core
php artisan laravue:setup
This command will do these steps:
- Setup JWT secret and API endpoint
- Publish Laravue vendor packages/assets
- Install NPM dependencies
- Create .babelc file (if it doesn't exist)
- Setup webpack.mix.js (please backup this file to make sure the current setting will not be lost)
# Change default auth guard to api
'defaults' => [
'guard' => 'api',
],
...
# Use JWT driver for api guard
'guards' => [
....
'api' => [
'driver' => 'jwt',
....
# Use Laravue User model to authenticate
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => Tuandm\Laravue\User::class,
],
Please reference to auth.php sample
Laravue core requires users.role
field, consider to run migration and data seeder (for sample data if necessary)
php artisan migrate
php artisan db:seed --class=Tuandm\\Laravue\\Database\\Seeds\\DatabaseSeeder
It's recommended to use laravue:setup command. If you want to manually install, you can do following commands:
php artisan vendor:publish --provider="Tuandm\Laravue\ServiceProvider" --tag="laravue-core"
php artisan vendor:publish --provider="Tuandm\Laravue\ServiceProvider" --tag="laravue-asset"
npm add babel-plugin-syntax-dynamic-import babel-plugin-syntax-jsx babel-plugin-transform-vue-jsx eslint eslint-loader eslint-plugin-vue laravel-mix-eslint vue-template-compiler svg-sprite-loader --save-dev
npm add element-ui js-cookie normalize.css nprogress vuex vue-count-to vue-i18n vue-router
npm install # To make sure everything is set
Please check package.json sample
We need to modify the webpack.mix.js to work with Laravue package, please reference to webpack.mix.js sample
Or simply run this command to generate recommendation version.
php artisan laravue:webpack
Laravue requires babel to build the packages. Usually, .babelrc
will be generated with laravue:setup command. Please manual add required plugins to .babelrc
file if your project already uses it. Sample .babelrc
can be found here
npm run dev # or npm run watch
npm run production