labolagen/laravel-generator

Labolagen, laravel-boilerplate + laravel-generator

6.0.x-dev 2022-08-05 07:56 UTC

This package is auto-updated.

Last update: 2024-06-09 09:02:56 UTC


README

Total Downloads Monthly Downloads Daily Downloads License

Labolagen - which is short for LAravel-BOilerplate LAravel-GENerator, combines rappasoft/laravel-boilerplate and InfyOmLabs/laravel-generator together.

Since laravel-boilerplate is using CoreUI, only the infyomLabs/coreui-templates is implemented and renamed to labolagen/coreui-templates.

Usage

  1. Install rappasoft/laravel-boilerplate
  2. composer require labolagen/laravel-generator:^6.0-dev
  3. php artisan vendor:publish --provider="Labolagen\Generator\LabolagenGeneratorServiceProvider"
  4. php artisan labolagen:publish
  5. php artisan labolagen.publish:layout
  6. Open app/Providers/RouteServiceProvider.php, found mapApiRoutes function, add ."\\API" at the end of $this->namespace(i.e. ->namespace($this->namespace."\\API")).
  7. Use it as InfyOmLabs/laravel-generator.

Because laravel-boilerplate is using CoreUI, so I've just implemented coreui-templates, it doesn't support adminlte-templates or any other templates which InfyOmLabs provided.

If you want to use DataTables in admin panel, do the following:

  1. composer require yajra/laravel-datatables:^1.5
  2. php artisan vendor:publish --tag=datatables-buttons
  3. Add <script src="{{ asset('vendor/datatables/buttons.server-side.js') }}"></script> before @stack('after-scripts') in resources/views/backend/layouts/app.blade.php
  4. npm install --save-dev datatables.net datatables.net-bs4 datatables.net-buttons datatables.net-buttons-bs4
  5. Add the follwing code at the bottom of resources/js/backend/app.js:
import dt from 'datatables.net';
import 'datatables.net-bs4';
import 'datatables.net-buttons';
import 'datatables.net-buttons-bs4';
  1. Run npm run dev or yarn dev
  2. Open resources/sass/backend/app.scss and add the following code to prevent searchbox shows in new line and pagination in new line:
div.dataTables_wrapper div.dataTables_filter {
    display: inline-block;
    float: right;
}
div.dataTables_wrapper div.dataTables_paginate{
    position: absolute;
    right: 10px;
    bottom: 0;
}

Documentation of laravel-generator is located here

Video Tutorials (Credits: shailesh-ladumor)