adifaidz/base

This package is abandoned and no longer maintained. No replacement package was suggested.

Laravel wrapper for frequently used package

v0.2.27 2017-04-04 01:21 UTC

README

Laravel wrapper for commonly used package and crud generators for basic crud functionalities

Before you start, read this

  • This package

    • Is a Laravel (Currently 5.4) package

    • Is still under heavy development 📢 🚧

    • Uses mainly Laravel, Vue, Bootstrap and Laravel-Mix

    • Affects some settings on installation ⚠️

    • Uses these npm packages:

      • admin-lte : ^2.3.8
      • axios: ^0.15.2
      • babel-plugin-transform-runtime: ^6.23.0
      • babel-preset-stage-2: ^6.22.0
      • bootstrap-sass: ^3.3.7
      • eonasdan-bootstrap-datetimepicker: ^4.17.43
      • font-awesome: ^4.7.0
      • jquery: ^3.1.0
      • laravel-mix: ^0.8.4
      • lodash: ^4.17.4
      • toastr: ^2.1.2
      • vue: ^2.0.1
      • vue-multiselect: 2.0.0-beta.13
      • vue-resource: ^1.0.3
      • vuetable-2: ^0.9.2

Features

  • Ready to use base functionalities (user profile, login, acl, etc )

  • Create crud components (views, controller, routes) based on eloquent model

  • Debug using phpdebugbar and logviewer based on your environment

  • Clean project using clean

  • Easily create menus with laravel-menu

Installation

  • Install using composer

      composer require adifaidz/base
    
  • Register the service provider to your providers array in config/app.php

      AdiFaidz\Base\Providers\BaseServiceProvider::class,
    
  • Run the install command using artisan, this will register guards, providers, password broker, route middlewares and middleware groups. It will also publish vue components, assets and bundling scripts and create route files.

      php artisan base:install
    
  • Add this to the boot method in app\Providers\AppServiceProvider.php to register all package routes

      use AdiFaidz\Base\Base;
    
      ...
    
      Base::routes();
    
  • Change the auth users provider model in config/auth.php to

      'users' => [
          'driver' => 'eloquent',
          'model' => AdiFaidz\Base\BaseUser::class,
      ],
    
  • Then, replace the current ExceptionHandler in bootstrap/app.php with Base ExceptionHandler class.

      $app->singleton(
          Illuminate\Contracts\Debug\ExceptionHandler::class,
          AdiFaidz\Base\Exceptions\Handler::class
      );
    
  • After that, add this to the map method in app\Providers\RouteServiceProvider.php for generated package routes

      use AdiFaidz\Base\Base;
    
      ...
    
      Base::mapBaseRoutes();
    
  • Then, configure your database connection and run migrate. Upon completion, tables for users, roles, permissions will be created

      php artisan migrate
    
  • Seed the tables

      php artisan db:seed --class="AdiFaidz\Base\Seeders\StartupSeeder"
    
  • And finally, run

      npm install && npm run watch
    
      or
    
      npm install && npm run dev
    
  • Start up your server and go to

      http://localhost/login
    

Todo 💻 ⌚

  • Create form and detail view based on model attributes

  • Fallback to mailtrap in development environment

  • Detailed documentation

  • Provide better flow