2017 © Pedro Peláez

library scaffenger



  • Friday, June 12, 2015
  • by wislem
  • Repository
  • 1 Watchers
  • 3 Stars
  • 24 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown


Scaffenger for Laravel 5.1

A scaffolding generator for any database setup ;), (*1)

It has its own UI (can be swapped with any custom made template)., (*2)

Supports a total of 17 column types including:, (*3)

Column type Description
pk The primary key of the table (usually id)
slug A varchar that gets slugified by the column with name title and type text
text Plain text
textarea Plain textarea
password A password column (has several functionalities for changing it or not preloading its value etc.)
wysiwyg It's a textarea marked as a wysiwyg along with the proper css class to load your preferred js editor (I'm using summernote here)
date A date field that gets formatted according to your needs and shows a datepicker in forms
datetime See date plus time support
fk If your table has relationships, then this type is for you
image Using dropzone.js to handle this on forms, shows thumbnail with lightbox in list view
file TODO
bool A 0|1 column
order input[type="number"] in forms and can be updated in the list view on the fly
select A set of custom selections (can be anything in your db table -- enum, tinyint... w/e)
url Text column (input[type="url"] in forms)
number Int column (input[type="number"] in forms)
email Email column (input[type="email"] in forms)
address TODO

Installation steps

Step 1: Install package

Add the package inside your composer.json requirements:, (*4)

composer require wislem/scaffenger

Add the ServiceProvider to your config/app.php file:, (*5)


In the User class, add the ShinobiTrait:, (*6)

use Pingpong\Traits\TrustyTrait;

class User extends Model implements AuthenticatableContract, CanResetPasswordContract {

    use Authenticatable, CanResetPassword, TrustyTrait;

    // ...

Step 2: Publish

php artisan vendor:publish

This will publish the following:

  • Config files
  • Migrations
  • Seeds
  • Assets
  • Views

Step 3: Run migrations and seeds

Add seeds to your main DatabaseSeeder class, (*7)


use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;

class DatabaseSeeder extends Seeder {

     * Run the database seeds.
     * @return void
    public function run()



Migrate and seed:, (*8)

php artisan migrate
php artisan db:seed
composer dump-autoload

That last command is so that Scaff's seeders will be autoloaded., (*9)

Result of the above actions

  • DB tables: users, password_resets (default Laravel migration) permissions, roles, permission_role, role_user (Pingpong\Trusty migrations) media, tests (Scaffenger's migrations)
  • Seeds
    • Roles
      • Administrator
      • Moderator
      • Member
    • Permission
      • access.admin
    • Users
      • admin@scaffenger.com:admin

Step 4

Navigate to /admin and play around., (*10)

What now?

Create your db table config files inside, (*11)


based on, (*12)


E.g., (*13)


and then you can navigate to, (*14)


to manage your db table through the UI., (*15)

Don't forget to add your newly created scaffold to the menu


Set your own custom controller for Scaffenger's custom actions like so:

Create your custom controller in your app/Http/Controllers, (*16)

<?php namespace App\Http\Controllers;

class CustomScaffengerController extends Controller {

  public function __construct()

  public function yourCustomAction(){


and set the route in /config/scaffenger/config.php, (*17)

The Versions