2017 © Pedro Peláez
 

library admin-laravel

Ready made admin for your laravel website.

image

daison/admin-laravel

Ready made admin for your laravel website.

  • Wednesday, November 2, 2016
  • by daison12006013
  • Repository
  • 2 Watchers
  • 8 Stars
  • 144 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 1 % Grown

The README.md

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

What I am looking for?

  • Developer - who can help me to change, refactor, and to add a feature.
  • Translator - you can help by translating the response messages.
  • Designer - a designer that can transform the assets into a unique design, instead of using free designs. The credit is yours.

Laravel Admin

I'm still keep on updating this admin package, when you are using the dev-master you will see some sample routes and navigation links, those are my examples to test all the functionality of this package. Each release has a branch and you need to switch for the said branch you used for specific README file., (*2)

Anyhow, I'm using this design http://www.blacktie.co/demo/dashgumfree/ as my basis, so try to review the code, later on I'll be importing other admin templates that you can easily configure. Thumbs Up!, (*3)

Start Up

Include this to your composer, if you want the most updated branch, use dev-master, (*4)

    "require": {
        "daison/admin-laravel": "1.2.*"
    }


Update your composer, (*5)

    composer update


Go to /app/config/app.php and add this line, (*6)

    'Daison\AdminLaravel\AdminLaravelServiceProvider',


Go to your command line and publish the config, view and assets, (*7)

    php artisan config:publish daison/admin-laravel
    php artisan view:publish daison/admin-laravel
    php artisan asset:publish daison/admin-laravel --path="vendor/daison/admin-laravel/src/assets"


Setup your database and laravel configuration, and run the package migrations, (*8)

    php artisan migrate --package="daison/admin-laravel"

Or if you have an existing Users table then use publish, (*9)

    php artisan migrate:publish daison/admin-laravel

Pre-Testing

Go to your browser localhost:8080/admin You can now access the admin login page, (*10)

Go to your command line, and lets create an account to test this admin panel ``` php artisan tinker, (*11)

$user = new User; $user->email = "email@gmail.com"; $user->password = Hash::make('abcd'); $user->save(); $role = new Role; $role->name = 'superuser'; $role->save(); $user_role = new UserHasRole; $user_role->user_id = $user->id; $user_role->role_id = $role->id; $user_role->save(); ```, (*12)

Go back to the page, and log your recently created account., (*13)

Tadda! Now you can see the navigation bar, the site name, and even the logout button, let's move to configuration., (*14)

Configuration

Remember we used this command php artisan config:publish daison/admin-laravel Go to /app/config/packages/daison/admin-laravel/ folder you can see these files, (*15)

  • lang
    • en.php
  • general.php
  • navigations.php
  • routes.php

Lets create our sample navigation,, (*16)

    [name] => [
      'name' => 'Navigation Name',
      'icon' => 'fa fa-home fa-fv',
      'url'  => '/admin/sample',
      'items'=> [
          [name] => [
              'name' => 'Second Level Nav Name',
              'icon  => '',
              'url'  => '/admin/sample/1',
          ],
          [name] => [
              'name' => 'Second Level Nav Name',
              'icon  => '',
              'url'  => '/admin/sample/2',
          ],
      ],
    ],

After creating these links with [items], refresh your page and see changes. You can even use 'roles' => ['superuser'] to limit the view access., (*17)

Routes

Based from our navigation links, we need to create a route to assign the controller to work with. You can also use the original routes file from /app/config/routes.php, but I suggest to use this approach to separate your original routes from admin routes. 'admin_sample_get' => [ 'process' => 'get', 'url' => '/admin/sample/', 'uses' => 'SampleController@showSample', ], 'admin_sample_post' => [ 'process' => 'post', 'url' => '/admin/sample/', 'uses' => 'SampleController@saveSample', ], 'admin_sample_rest_get' => [ 'process' => 'get', 'url' => '/admin/inventory/{id}/edit', 'uses' => 'InventoryController@showEditItem', ], 'admin_sample_rest_post' => [ 'process' => 'post', 'url' => '/admin/inventory/{id}/edit', 'uses' => 'InventoryController@updateItem', ], Now create your SampleController / InventoryController and it's up to you to handle the responses. You can even assign 'roles' => ['superuser'] to restrict each request, you can also provide 'is_auth' => true to redirect guest to the login page., (*18)

Still using Main Routes

So you still want to use the main app/routes.php, however you want to use the roles management to your routes. Go to your controller __construct and do the constructor injection., (*19)

  use Daison\AdminLaravel\AdminLaravel as Admin;

  class MyController
  {
    private $admin;
    public function __construct(Admin $admin)
    {
      $this->admin = $admin;
    }

    public function showProfile()
    {
      if ($this->admin->hasAnAccess(['superuser','agent']) == false) {
        // It means the Authenticated user doesn't have roles
        // Redirect the user, show the access not allowed page... and so on..
      }
    }

    public function saveProfile()
    {
      // same thing as the showProfile() method.
    }
  }

I am still updating this README., (*20)

The Versions

02/11 2016

dev-master

9999999-dev https://github.com/daison12006013/admin-laravel

Ready made admin for your laravel website.

  Sources   Download

MIT

The Requires

 

by Daison Carino

laravel php twitter bootstrap admin administrator

07/04 2015

1.2.0.x-dev

1.2.0.9999999-dev https://github.com/daison12006013/admin-laravel

Ready made admin for your laravel website.

  Sources   Download

MIT

The Requires

 

by Daison Carino

laravel php twitter bootstrap admin administrator

07/04 2015

1.2.2.4

1.2.2.4 https://github.com/daison12006013/admin-laravel

Ready made admin for your laravel website.

  Sources   Download

MIT

The Requires

 

by Daison Carino

laravel php twitter bootstrap admin administrator

17/03 2015

1.2.2.3

1.2.2.3 https://github.com/daison12006013/admin-laravel

Ready made admin for your laravel website.

  Sources   Download

MIT

The Requires

 

by Daison Carino

laravel php twitter bootstrap admin administrator

11/03 2015

1.2.2.2

1.2.2.2 https://github.com/daison12006013/admin-laravel

Ready made admin for your laravel website.

  Sources   Download

MIT

The Requires

 

by Daison Carino

laravel php twitter bootstrap admin administrator

27/02 2015

1.2.0

1.2.0.0 https://github.com/daison12006013/admin-laravel

Ready made admin for your laravel website.

  Sources   Download

MIT

The Requires

 

by Daison Carino

laravel php twitter bootstrap admin administrator

27/02 2015

1.1.2.x-dev

1.1.2.9999999-dev https://github.com/daison12006013/admin-laravel

Ready made admin for your laravel website.

  Sources   Download

MIT

The Requires

 

by Daison Carino

laravel php twitter bootstrap admin administrator

27/02 2015

1.1.2

1.1.2.0 https://github.com/daison12006013/admin-laravel

Ready made admin for your laravel website.

  Sources   Download

MIT

The Requires

 

by Daison Carino

laravel php twitter bootstrap admin administrator

13/02 2015

1.1.0.x-dev

1.1.0.9999999-dev https://github.com/daison12006013/admin-laravel

Ready made admin for your laravel website.

  Sources   Download

MIT

The Requires

 

by Daison Carino

laravel php twitter bootstrap admin administrator

03/02 2015

1.0.0.x-dev

1.0.0.9999999-dev https://github.com/artdarek/oauth-4-laravel

Ready made admin for your laravel website.

  Sources   Download

MIT

The Requires

 

by Daison Carino

laravel php twitter bootstrap admin administrator