Stars: 263
Forks: 107
Pull Requests: 51
Issues: 92
Watchers: 33
Last Updated: 2021-05-10 02:09:26
Laravel 5.7 Boilerplate based on Bootstrap 4 and Vue Tabler for Backend.
License: MIT License
Languages: PHP, HTML, Vue, Makefile, Dockerfile
This is a Bootstrap 4 starter kit site with lite blogging feature, user account registration/management and full Vue Tabler Backend based on Laravel 5.7.
For Mariadb you can use this laravel-mariadb package.
composer create-project --prefer-dist --stability=dev adr1enbe4udou1n/laravel-boilerplate my-new-project
bootstrap/cache
and storage
folders.composer install
php artisan key:generate
php artisan storage:link
php artisan migrate [--seed]
# Running this on development environment will throw error so run below command only on production
composer install --no-dev --optimize-autoloader
php artisan key:generate
php artisan storage:link
php artisan migrate --force
php artisan scout:import "App\Models\Post"
Laravel Scout takes care of updating posts index on Create, Update and Delete (CUD) operations.
After installation the site will be available on 127.0.0.1:8080
First of all you need to build the containers
docker-compose build
After that you have to start the containers
docker-compose up
Set up your application
docker exec -it boilerplate-php-fpm php /app/artisan key:generate \
&& docker exec -it boilerplate-php-fpm php /app/artisan storage:link
Rename .env.docker
to .env
and apply the migrations
docker exec -it boilerplate-php-fpm php /app/artisan migrate
Or apply the migrations with demo data
docker exec -it boilerplate-php-fpm php /app/artisan migrate --seed
docker-compose build
After that you have to start the containers
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
Set up your application
docker exec -it boilerplate-php-fpm php /app/artisan key:generate \
&& docker exec -it boilerplate-php-fpm php /app/artisan storage:link
Rename .env.docker
to .env
and apply the migrations
docker exec -it boilerplate-php-fpm php /app/artisan migrate
Run
make build
make start.dev
After first start rename .env.docker
to .env
and apply the migrations by the following command
make install.dev
Run
make build
make start.prod
After first start rename .env.docker
to .env
and apply the migrations by the following command
make install.prod
First of all set up your docker environment
set COMPOSE_CONVERT_WINDOWS_PATHS=1
;Docker for Windows settings > Shared Drives > Reset credentials > select drive > Apply;
Note, if the prompt from the needed drive disapears after restarting the container
You may have to reset your docker:
Go to Docker for Windows settings > Reset > Reset to factory defaults...
Than you can proceed with Mac and Linux
install instructions section
The first user to register will be automatically super admin with no restriction and will cannot be deletable. Both frontend and backend have dedicated login pages.
yarn
yarn dev
for compiling assets and start dev-server with HMR enabled (preferred way for fast admin building)N1 : Use DEV_SERVER_PORT variable to configure local port of Webpack Dev Server,
N2 : Use DEV_SERVER_URL to configure HTTP access to Webpack Dev Server from your host, especially useful if you work on homestead/docker),
N3 : Useyarn watch
if you prefer old school watcher,
N4 : If assets modified, don't forget to launchyarn prod
before deploy on production environment.
Unlike other known project as ENTRUST or laravel-permission, which are very well suited for generic roles/permissions, i preferred a more lite and integrated custom solution.
The mainly difference is that instead of store all permissions into specific SQL table, there are directly defined in a specific config file permissions. SQL side, roles entities relies only to a list of permissions key names.
Indeed i feel this approach better for maintainability simply because permissions are hardly tied to the application with Laravel Authorization. This is anyway the standard way in CMS as Drupal where each module have specific config permission file. Permissions should be only owned by developers.
You will observe that this boilerplate does not use Laravel Mix which is shipped in Laravel for all assets management.
Laravel Mix still stay awesome for newcomers thanks to Jeffrey Way's laravel-like webpack fluent API, but, even if Laravel Mix can be easily overridden, for this project i preferred use my custom framework-free webpack setup in order to have total control of assets workflow.
For instance, with this custom setup HMR work natively with configurable port (essential for easy vue admin development) and productions assets are bundled into specific "dist" directory.
PHP-CS-Fixer & ESLint are used for strong style guidelines for both server and client side code.
PHP is pre-configured for official Laravel styling, just launch ./vendor/bin/php-cs-fixer fix
for global project auto-formatting.
JS use Prettier Standard Style & eslint-loader is used within webpack for dynamic code styling recommendations.
Moreover, Official ESLint plugin for Vue.js is included for heavy consistent code through all components vue files.
This project is open-sourced software licensed under the MIT license.