PHPackages                             gogilo/admin-md - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. gogilo/admin-md

ActiveLibrary[Admin Panels](/categories/admin)

gogilo/admin-md
===============

Material Dashboard themed CMS for Laravel

0.0.0(2y ago)055MITJavaScriptCI failing

Since Jul 10Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/gogilo2003/admin-md)[ Packagist](https://packagist.org/packages/gogilo/admin-md)[ RSS](/packages/gogilo-admin-md/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

Bootstrap CMS for Laravel
=========================

[](#bootstrap-cms-for-laravel)

This package is a Content Management System for a laravel website with all the common features available. It has a fully functional backend for administering the website and uses Laravel 5.\*, bootstrapCSS, jquery, fontawesome, DataTables, Tinymce, etc.

It is very simple to setup and use. One will only need to create a theme for their website using blade templates as would be necessary.

Installation
------------

[](#installation)

### Through Composer

[](#through-composer)

```
composer require gogilo/admin
```

#### Or

[](#or)

You can also update your composer.json as follows

```
"require": {
    "gogilo/admin": "dev-master"
}
```

then run

```
composer update
```

### Add service provider to the list of providers

[](#add-service-provider-to-the-list-of-providers)

This step is optional for those using Laravel 5.5 and above, as the package is discoverable by laravel. But incase you disable discovarability for this package or if you are using a lower version of Laravel, you can always add this service provider to you list of service providers in the config/app.php file

```
Ogilo\AdminMd\AdminServiceProvider::class,
```

### Handling guest access to the admin routes

[](#handling-guest-access-to-the-admin-routes)

To ensure the user is directed to the correct login page why trying to access the admin page, modify the unauthenticated() function in the app/Exceptions/Handler.php by adding

```
if(is_admin_path()){
    return redirect()->guest('admin/login');
}
```

in case the function is not already in your exceptions handler class, you can just add the function below to overide the inherited function.

```
php artisan admin:fix_exception
```

### Install or Update

[](#install-or-update)

run artisan admin:install/admin:update command to create all the necessary tables for the CMS including all roles and user tables as well as publish all required resources;

This Commands will install all frontend components, create the necessary database structure(perform migrations) and publish necessary resources for the package.

```
php artisan admin:install
```

After every update of gogilo/admin, it's necessary to run the admin:update command as this will fix any database structure changes, any theme changes and also perform necessary cleanup/housekeeping.

```
php artisan admin:update
```

### Configure sanctum

[](#configure-sanctum)

Configure sanctum for spa api authentication

1. in the app/Http/Kernel.php file uncomment `EnsureFrontendRequestsAreStateful::class` middleware

```
    \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
    'throttle:api',
    \Illuminate\Routing\Middleware\SubstituteBindings::class,
],

```

2. in the config/sanctum.php file change the

`'guard' => ['web'],`

to

`'guard' => ['admin'],`

3. in the config/cors.php file change the line

`'supports_credentials' => false,`

to

`'supports_credentials' => true,`

4. update your .env file with the following

```
SESSION_DOMAIN=.example.com

```

### Guards and Auth Providers

[](#guards-and-auth-providers)

Update the config/auth.php file to include the admins provider and admin guard

To the list of your auth providers, add

```
'admins' => [
    'driver' => 'eloquent',
    'model' => Ogilo\AdminMd\Models\Admin::class,
],
```

To the list of your guards, add

```
'admin' => [
    'driver' => 'session',
    'provider' => 'admins',
],
```

remember for api too

```
'api' => [
    'driver' => 'token',
    'provider' => 'admins',
    'hash' => false,
],
```

Add the login route to the routes/web.php

```
php artisan admin:fix_route
```

### Extending Admin

[](#extending-admin)

You can easily add more items to the admin section of the CMS by creating your iwn custom content type and providing links to the content type you have created. It can either be in your application by adding a couple of Controllers, Models and Views.

#### Routes

[](#routes)

Ensure that your routes are protected by "auth:admin" guard

##### Example

[](#example)

```
Route::group(['middleware'=>'auth:admin','prefix'=>'admin','as'=>'admin'],function(){
    Route::get('',['as'=>'-example','uses'=>'SomeController@someMethod']);
});
```

this will create a route named admin-example with uri /admin/example

#### Menu

[](#menu)

Add your Item to the admin menu/nav by adding it to the admin.menu config. This you should do in the boot method of the application's/package's service provider class.

###### Example

[](#example-1)

```
class AppServiceProvider{
    ...
    function boot(){
        config(['admin.menu.admin-example'=>'Examples']);
    }
    ...
}
```

##### Sub Menus

[](#sub-menus)

You can also create a dropdown menu(s) using the above simple configurations. Use your config name as the key while the submenu(s) and items will take place of the caption as an array of submenus.

###### Example

[](#example-2)

```
function boot(){
        config(['admin.menu.admin-example'=>[
            [
                'caption'=>'Menu One',
                'submenu'=>[
                    'menu-one-route-name-one'=>'Caption One',
                    'menu-one-route-name-two'=>'Caption Two',
                    'menu-one-route-name-three'=>'Caption Three',
                    'menu-one-route-name-four'=>'Caption Four',
                ]
            ],[
                'caption'=>'Menu Two',
                'submenu'=>[
                    'menu-two-route-name-one'=>'Menu 2 Caption One',
                    'menu-two-route-name-two'=>'Menu 2 Caption Two',
                    'menu-two-route-name-three'=>'Menu 2 Caption Three',
                    'menu-two-route-name-four'=>'Menu 2 Caption Four',
                    'menu-two-route-name-five'=>'Menu 2 Caption Five',
                ]
            ]
        ]]);
    }
```

If you only have one sub-menu, you can just pass the array to the root key as shown below

```
function boot(){
    config(['admin.menu.admin-example'=>
        [
            'caption'=>'Menu One',
            'submenu'=>[
                'menu-one-route-name-one'=>'Caption One',
                'menu-one-route-name-two'=>'Caption Two',
                'menu-one-route-name-three'=>'Caption Three',
                'menu-one-route-name-four'=>'Caption Four',
            ]
        ]
    ]);
}
```

**NOTE:** Each submenu must have a caption and submenu keys. The caption will be the caption of the menu while submenu cantains route caption key value pairs for all the items in the submenu.

To add a devider in the sub menu. just add a dash key value pair item

```
'-'=>'-'
```

```
'submenu'=>[
        'menu-one-route-name-one'=>'Caption One',
        'menu-one-route-name-two'=>'Caption Two',
        '-'=>'-',
        'menu-one-route-name-three'=>'Caption Three',
        'menu-one-route-name-four'=>'Caption Four',
    ]
```

#### Views

[](#views)

Your views should:

1. extend the admin::layout.main.
2. Have the following sections on your view i) title ii page\_title iii) breadcrumbs iv) sidebar v) content vi) styles vii) scripts\_top viii) scripts\_bottom

##### Example

[](#example-3)

```
@extends('admin::layout.main')

@section('title')
    Title
@endsection

@section('page_title')
     Item
@endsection

@section('breadcrumbs')
    @parent
     Item
@endsection

@section('sidebar')
    @parent
    {{-- @include('admin::some-additional sidebar items') --}}
@endsection

@section('content')
    Put content details
@endsection

@section('styles')

@endsection
@section('scripts_top')

@endsection

@section('scripts_bottom')

@endsection
```

### Feedback form handling

[](#feedback-form-handling)

Submit feedback by posting to the contact/post or contact-post route in Laravel. the following parameters need to be posted

```
url: domain.tld/contact/post
OR
url: {{ route('contact-post') }}

```

and the data

```
data:
{
    "name": "appropriate name",
    "email": "email@example",
    "phone": "valid phone number",
    "comments": "some comment text"
}
```

The name, email and comments fields are required.

#### Response

[](#response)

On submission of the comment, you'll get a json response for error or success

##### Error

[](#error)

```
{
    "success": false,
    "message": "Additional error message"
}
```

##### Success

[](#success)

```
{
    "success": true,
    "message": "Success message"
}
```

You can handle this response and give appropriate response.

Input fileds in views
---------------------

[](#input-fileds-in-views)

### Select

[](#select)

To enable select picker on you select fields, include the following properties for the select element

```

```

#### Example

[](#example-4)

```

Text 1
Text 2
Text 3
Text 4

```

Frontend
--------

[](#frontend)

You can now use vuejs in your admin pages. all admin related vuejs components along with any related sass files will be compiled into admin.js and admin.css files respectively, this therefore requires that you you modify the wbpack.mix.js to cover these two files. The following steps will help you in handling this situation.

### 1. Publish Vue Resources

[](#1-publish-vue-resources)

run the publish artisan command with the tag vue-resources as follows

```
php artisan vendor:publish --tag=vue-resources
```

### 2. Update webpack.mix.js file

[](#2-update-webpackmixjs-file)

Add compilation of admin.js and admin.css to webpack config

```
mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css')
   .js('resources/assets/vendor/admin/js/admin.js','public/vendor/admin/js')
   .sass('resources/assets/vendor/admin/scss/admin.scss', 'public/vendor/admin/css');
```

SETUP
-----

[](#setup)

Admin CMS is now equiped with a quick tool for webmasters to generate the sitemap of the website quickly and effeciently use the url \[site\_url\]/admin/setup

Click Grenerate Sitemap and one will be quickly generated for you on the website public\_path

You also have the alternative of making using console by running the command

```
php artisan sitemap:generate
```

You can schedule the generation of the sitemap at regular intervals using laravel's task scheduler

```
// app/Console/Kernel.php
protected function schedule(Schedule $schedule)
{
    ...
    $schedule->command('sitemap:generate')->daily();
    ...
}
```

Happy websiting

By George Ogilo +254711347184/+254735388704

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 99.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1043d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dcf3ddd4de0a280585a1e3bfb08d635147cb1535d7ec7fe37fcfbafdd66c61f?d=identicon)[gogilo2003](/maintainers/gogilo2003)

---

Top Contributors

[![gogilo2003](https://avatars.githubusercontent.com/u/5575977?v=4)](https://github.com/gogilo2003 "gogilo2003 (434 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

cmsbootstrapContent management systemLaravel CMSMaterial Dashboard themed CMS for Laravel

### Embed Badge

![Health badge](/badges/gogilo-admin-md/health.svg)

```
[![Health](https://phpackages.com/badges/gogilo-admin-md/health.svg)](https://phpackages.com/packages/gogilo-admin-md)
```

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.4M207](/packages/backpack-crud)[eveseat/web

SeAT Web Interface

2723.2k135](/packages/eveseat-web)[alexstack/laravel-cms

Simple Bootstrap Laravel CMS. Can integrate to any existing Laravel project. Only add few database tables with prefix, not effect your existing database tables. Support Laravel 8.x &amp; 7.x &amp; Laravel 6.x &amp; Laravel 5.x - Amila Laravel CMS

1084.3k5](/packages/alexstack-laravel-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
