PHPackages                             cogroup/cms - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. cogroup/cms

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

cogroup/cms
===========

CMS for all laravel projects

v3.0.7(4y ago)0182[10 PRs](https://github.com/COgroup-sas/cms/pulls)MITPHPPHP &gt;=7.2

Since Sep 28Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/COgroup-sas/cms)[ Packagist](https://packagist.org/packages/cogroup/cms)[ Docs](https://wwww.cogroupsas.com)[ RSS](/packages/cogroup-cms/feed)WikiDiscussions 3.0 Synced 2mo ago

READMEChangelogDependencies (5)Versions (25)Used By (0)

[![](https://camo.githubusercontent.com/7a72ca9f9884bfffb719d37906891308e6b533dec6f5e9d282bce7001cf3176c/68747470733a2f2f7777772e636f67726f75707361732e636f6d2f676974696d616765732f636f67726f75702e737667)](https://camo.githubusercontent.com/7a72ca9f9884bfffb719d37906891308e6b533dec6f5e9d282bce7001cf3176c/68747470733a2f2f7777772e636f67726f75707361732e636f6d2f676974696d616765732f636f67726f75702e737667)

[![Latest Stable Version](https://camo.githubusercontent.com/9f90a4759a5d242b35c5bb54b72708b3477f60557066bfa367939b883cc032db/68747470733a2f2f7777772e636f67726f75707361732e636f6d2f676974696d616765732f76657273696f6e3330302e737667)](https://packagist.org/packages/cogroup/cms)[![License](https://camo.githubusercontent.com/cf414b744d719c9aea92da89185e0c759676f32991a06e98dc880c5019e78ec2/68747470733a2f2f7777772e636f67726f75707361732e636f6d2f676974696d616765732f6c6963656e73652e737667)](https://packagist.org/packages/cogroup/cms)

Important:
==========

[](#important)

To avoid incompatibilities, it is necessary to remove popper, jquery and bootstrap from webpack; our library already includes the most recent ones.

Comment all require files in:

```
resources/js/bootstrap.js
```

Cms
===

[](#cms)

### For Laravel &lt; 5.7, please use the [1.6 branch](https://github.com/COgroup-sas/cms/tree/1.6)!

[](#for-laravel--57-please-use-the-16-branch)

### For Laravel &lt;= 6, please use the [1.8 branch](https://github.com/COgroup-sas/cms/tree/1.8)!

[](#for-laravel--6-please-use-the-18-branch)

### For Laravel 7, please use the [2.0 branch](https://github.com/COgroup-sas/cms/tree/2.0)!

[](#for-laravel-7-please-use-the-20-branch)

### For Laravel 8, please use the [3.0 branch](https://github.com/COgroup-sas/cms/tree/3.0)!

[](#for-laravel-8-please-use-the-30-branch)

COgroup - CMS package is a flexible way to add basic CMS system with Role-based Permissions to **Laravel**.

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Intervention Image](#interventionimage)
- [Configuration](#configuration)
    - [User relation to roles](#user-relation-to-roles)
    - [Models](#models)
        - [Files](#files)
        - [Modules](#modules)
        - [No Working Days](#noworkingdays)
        - [Roles](#roles)
        - [Roles Access](#rolesaccess)
        - [Settings](#settings)
        - [User](#user)
- [Usage](#usage)
    - [Middleware](#middleware)
    - [Helper Permission](#helper-permission)
    - [Helpers](#helpers)
        - [cms\_get\_modules](#cms_get_modules)
        - [cms\_settings](#cms_settings)
        - [cms\_format\_date](#cms_format_date)
        - [cms\_format\_time](#cms_format_time)
        - [cms\_format\_datetime](#cms_format_datetime)
        - [cms\_get\_file\_attribute](#cms_get_file_attribute)
    - [Notifications javascript](#notifications-javascript)
- [License](#license)
- [Contribution guidelines](#contribution-guidelines)
- [Additional information](#additional-information)

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

[](#installation)

1. Run the command to install laravel/ui and generate scaffolding

```
composer require laravel/ui
php artisan ui bootstrap --auth
```

2. In order to install COgroup - CMS, just add the following to your composer.json. Then run `composer update`:

```
"cogroup/cms": "^3.0"
```

or run the next command:

```
composer require cogroup/cms "3.*"
```

3. fixed Auth::routes, to avoid Clouser error

Remove Auth::routes from web.php file

4. Run the command below to publish the package config file `config/cogroupcms.php`:

```
php artisan vendor:publish --provider="Cogroup\Cms\CmsServiceProvider"
```

5. Run the command below to execute migrations

```
php artisan migrate
```

6. Run the command below to seed

```
php artisan db:seed --class=CogroupCmsSeeder
```

7. Run the command below to re-publish assets, config, custom error views, font, migrations and translations

```
php artisan cogroupcms:assets
php artisan cogroupcms:config
php artisan cogroupcms:errorviews
php artisan cogroupcms:fonts
php artisan cogroupcms:migrations
php artisan cogroupcms:seeders
php artisan cogroupcms:translations
```

6. Change default User model in `config/auth.php file`

```
'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => Cogroup\Cms\Models\User::class,
    ],

    // 'users' => [
    //     'driver' => 'database',
    //     'table' => 'users',
    // ],
],
```

### InterventionImage

[](#interventionimage)

After you have installed Intervention Image, open your Laravel config file `config/app.php` and add the following lines.

In the `$providers` array add the service providers for this package.

`Intervention\Image\ImageServiceProvider::class`

Add the facade of this package to the $aliases array.

`'ImageManager' => Intervention\Image\Facades\Image::class`

Now the Image Class will be auto-loaded by Laravel.

#### Publish configuration in Laravel 5

[](#publish-configuration-in-laravel-5)

```
$ php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravelRecent"
```

Configuration
-------------

[](#configuration)

Set the property values in the `config/cogroupcms.php`. These values will be used by cogroup-cms to refer to the correct prefix, color theme and URI to CMS access.

### User relation to roles

[](#user-relation-to-roles)

You may now run it with the artisan migrate command:

```
php artisan migrate
```

After the migration, seven new tables will be present:

- `files` — manage files into CMS
- `modules` — modules for CMS
- `noworkingdays` — dates for special days, and to be able to discount in a range of dates
- `roles` — roles for CMS
- `roles_access` — relations between roles and modules access
- `settings` — CMS basic settings (sitename, emailname, etc.)
- `user` — Table for users and specific rol user

### Models

[](#models)

#### Files

[](#files)

The `Files` model has eight main attributes:

- `originalname` — Original name of the file.
- `diskname` — name of the file into system after upload.
- `extension` — extension of the file.
- `size` — size of the file.
- `mimetype` — Mime type of the file.
- `alt` — Texto for label alt in HTML.
- `width` — when is image, a width attribute.
- `height` — when is image, a height attribute.
- `ispublic` — determines whether a file is public or not.
- `created_at` — determines the creation date.
- `updated_at` — determine the update date.

#### Modules

[](#modules)

The `Modules` model has ten main attributes:

- `moduleslug` — Slug name for the module, to verify permissions.
- `modulename` — Module name to show.
- `description` — A more detailed explanation of what the Module does.
- `active` — module is active or not.
- `url` — url to acces the module. The url should not have the domain.
- `icon` — font icon of the module.
- `parent` — When is a submodule, id of the parent module. When is a father module is 0.
- `order` — order to show module in the menu.
- `inmenu` — determines if the module is show in the main menu.
- `permissions` — Determine what permissions the module needs. They must be separated by commas. Example: "view, create".

#### NoWorkingDays

[](#noworkingdays)

The `NoWorkingDays` model has two main attributes:

- `date` — special day date.
- `active` — determines whether a date is active or not.
- `created_at` — determines the creation date.
- `updated_at` — determine the update date.

#### Roles

[](#roles)

The `Role` model has two main attributes:

- `rolname` — Unique name for the Role, used for looking up role information in the application layer. For example: "admin", "owner", "employee".
- `description` — A more detailed explanation of what the Role does.
- `created_at` — determines the creation date.
- `updated_at` — determine the update date.

#### RolesAccess

[](#rolesaccess)

The `RolesAccess` model has six main attributes:

- `roles_id` — Unique key for the Role, used for relation to table roles.
- `modules_id` — Unique key for the modules, used for relation to table modules.
- `view` — Set the permission to see a module or submodule.
- `create` — Set the permission to create content in a module or submodule.
- `update` — Set the permission to update content in a module or submodule.
- `delete` — Set the permission to delete content in a module or submodule.
- `created_at` — determines the creation date.
- `updated_at` — determine the update date.

#### Settings

[](#settings)

The `Settings` model has two main attributes:

- `setting` — Unique name for the setting.
- `defaultvalue` — A value for the setting attribute.

#### User

[](#user)

This will enable the relation with `Role`.

**And you are ready to go.**

Usage
-----

[](#usage)

### Middleware

[](#middleware)

You can use a middleware to filter routes and route groups by permission or role

```
Route::group(['prefix' => 'settings', 'middleware' => ['admin:settings|view']], function() {
    Route::get('/', 'AdminController@welcome');
    Route::post('/', ['middleware' => ['admin:settings|create,update'], 'uses' => 'AdminController@manageAdmins']);
});
```

It is possible to use comma symbol to verify until two actions:

```
'middleware' => ['role:admin|create,update']
```

### Helper Permission

[](#helper-permission)

You can use a helper to verify a permission

```
cms_roles_check($check, $moduleslug, $type);
```

- `check` is a Auth::user info or module id.
- `moduleslug` is a slug of the module to check permission.
- `type` is optional permission, by default it is `view`.

Helpers
-------

[](#helpers)

Cogroup - CMS includes a two "helper" PHP functions. These functions are used by the package itself; however, you are free to use them in your own applications if you find them convenient.

### cms\_get\_modules

[](#cms_get_modules)

This function return a modules of the system, register into table `modules`.

```
cms_get_modules($modulename, $inmenu, $idrol);
```

- `modulename` is optional parameter. If is NULL return all modules.
- `inmenu` By default it is `Y`. The other option is `N`.
- `idrol` is optional parameter, by default it is `NULL`. When present, it returns the modules associated with the role that have permission `view`

### cms\_settings

[](#cms_settings)

This function return a object with settings values

```
cms_settings();
```

Example: `cms_settings()->sitename`

### cms\_format\_date

[](#cms_format_date)

This function return a Carbon format date with the dateformat setting format

```
cms_format_date($date);
```

- `date` is required parameter. The date format must be Y-m-d.

### cms\_format\_time

[](#cms_format_time)

This function return a Carbon format date with the timeformat setting format

```
cms_format_time($time);
```

- `time` is required parameter. The time format must be H:i:s.

### cms\_format\_datetime

[](#cms_format_datetime)

This function return a Carbon format date with the dateformat and timeformat setting format

```
cms_format_datetime($datetime);
```

- `datetime` is required parameter. The date format must be Y-m-d H:i:s.

### cms\_get\_file\_attribute

[](#cms_get_file_attribute)

This function return a attribute FileModel

```
cms_get_file_attribute($id, $attribute);
```

- `id` is required parameter. Id into table `Files`
- `attribute` is required parameter. Column of the table `Files`

### cms\_get\_total\_unread\_notifications

[](#cms_get_total_unread_notifications)

This function return a number of total unread notifications system

```
cms_get_file_attribute();
```

### Dashboard

[](#dashboard)

For change dashboard, change option dashboard into `config/cogroupcms.php` file. Add all namespace example: `\App\Http\Controllers\MyDashboardController`

### Notifications Messages

[](#notifications-messages)

config channels into config/cogroupcms.php via option

```
'via' => ['mail', 'database'],
```

If use a mail channel add `use Cogroup\Cms\Notifications\NewMessage;` to your Controller.

For send message use `Notification::send( $user, new NewMessage( $from, $message ) );`

- `$user` is the user to send email. Object User
- `$from` is the user from send email. Object User
- `$message` is a data message

Notifications Javascript
------------------------

[](#notifications-javascript)

This configuration to set a float message from Controller

Set 0 to error, 1 to success, 2 to info, 3 to warning

```
$request->session()->flash('status', '1');
```

Set a position (top, bottom)

```
$request->session()->flash('msgfrom', {position});
```

Set a align (left, center, right)

```
$request->session()->flash('msgfrom', {align});
```

Set delay time (default: 4000)

```
$request->session()->flash('msgtime', {time});
```

Set a message

```
$request->session()->flash('msg', {message});
```

License
-------

[](#license)

COgroup CMS is free software distributed under the terms of the MIT license.

Contribution guidelines
-----------------------

[](#contribution-guidelines)

Support follows PSR-4 PHP coding standards, and semantic versioning.

Please report any issue you find in the issues page. Pull requests are welcome.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance43

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 97.2% 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

Every ~195 days

Recently: every ~394 days

Total

14

Last Release

254d ago

Major Versions

v1.6.0 → v3.0.42021-03-26

v1.7.2 → v2.0.52021-05-01

1.6.x-dev → 3.1.x-dev2021-06-23

PHP version history (4 changes)v1.6.0PHP &gt;=7.1.0

v3.0.4PHP &gt;=7.2

v1.7.2PHP ^7.1.3

3.1.x-devPHP ^7.3|^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f63ef502bf65962f2fa3c557cc79dc2281a069eef169fb552ac757b092a6487a?d=identicon)[camachogfelipe](/maintainers/camachogfelipe)

---

Top Contributors

[![camachogfelipe](https://avatars.githubusercontent.com/u/13385589?v=4)](https://github.com/camachogfelipe "camachogfelipe (106 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

laravelauthcmspermissionrolesilluminateadmin

### Embed Badge

![Health badge](/badges/cogroup-cms/health.svg)

```
[![Health](https://phpackages.com/badges/cogroup-cms/health.svg)](https://phpackages.com/packages/cogroup-cms)
```

###  Alternatives

[acoustep/entrust-gui

A GUI for the Entrust package.

11425.7k](/packages/acoustep-entrust-gui)[codebot/entrust

This package provides a flexible way to add Role-based Permissions to Laravel

1596.6k](/packages/codebot-entrust)

PHPackages © 2026

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