PHPackages                             shabaz-ejaz/laracogs - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. shabaz-ejaz/laracogs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shabaz-ejaz/laracogs
====================

Prepare your Laravel apps incredibly fast, with various commands, services, facades and boilerplates.

1921PHP

Since May 3Pushed 8y agoCompare

[ Source](https://github.com/shabaz-ejaz/laracogs)[ Packagist](https://packagist.org/packages/shabaz-ejaz/laracogs)[ RSS](/packages/shabaz-ejaz-laracogs/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Laracogs
========

[](#laracogs)

**Laracogs** - A handful of tools for Rapid Laravel Development

[![Build Status](https://camo.githubusercontent.com/520a494b3e48b15a716bca892694b219200b694214cdddac7f124407d693fb5d/68747470733a2f2f7472617669732d63692e6f72672f59414268712f4c617261636f67732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/YABhq/Laracogs)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bd0fd7acb81ba1f363732d11903792823f32cd508cbc5a2b784472b5d95c66a5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f59414268712f4c617261636f67732f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/YABhq/Laracogs/?branch=develop)[![Packagist](https://camo.githubusercontent.com/71cb847db3008dd1f257f9ca1d75141d70380205cf3e810334e059c5e24c0a58/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7961622f6c617261636f67732e7376673f6d61784167653d32353932303030)](https://packagist.org/packages/yab/laracogs)[![license](https://camo.githubusercontent.com/ee061e6c1798bd95fa104c910010a3119850b186c323a1c848b3abcb029dc764/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e7376673f6d61784167653d32353932303030)](https://packagist.org/packages/yab/laracogs)

This is a set of tools to help speed up development of Laravel apps. You can start an app with various parts prewritten (Users, User Meta, Roles, Teams). And it comes with a powerful FormMaker which can generate form content from tables, and objects. It can generate epic CRUD prototypes rapidly with full testing scripts prepared for you, requiring very little editing. It also provides an elegant Cryptography tool which is URL friendly. Finally it brings along some friends with LaravelCollective as a vendor.

##### Author(s):

[](#authors)

- [Matt Lantz](https://github.com/mlantz) ([@mattylantz](http://twitter.com/mattylantz), matt at yabhq dot com)
- [Chris Blackwell](https://github.com/chrisblackwell) ([@chrisblackwell](https://twitter.com/chrisblackwell), chris at yabhq dot com)

Website
-------

[](#website)

Yab Newsletter
--------------

[](#yab-newsletter)

[Subscribe](http://eepurl.com/ck7dSv)

Chat Support
------------

[](#chat-support)

[Gitter](https://gitter.im/YABhq/Laracogs)

Detailed Documentation
----------------------

[](#detailed-documentation)

Please consult the documentation here:

General Requirements
--------------------

[](#general-requirements)

1. PHP 5.6+
2. OpenSSL

Compatibility and Support
-------------------------

[](#compatibility-and-support)

Laravel VersionPackage TagSupported5.5.x2.3.xyes5.4.x2.2.xyes5.3.x2.0.x - 2.1.xno5.1.x - 5.2.x1.9.xno---

### Installation

[](#installation)

Start a new Laravel project:

```
composer create-project laravel/laravel your-project-name
```

Then run the following to add Laracogs

```
composer require "yab/laracogs"
```

Add this to the `config/app.php` in the providers array:

```
Yab\Laracogs\LaracogsProvider::class,
```

##### After these few steps you have the following tools at your fingertips:

[](#after-these-few-steps-you-have-the-following-tools-at-your-fingertips)

CrudMaker
---------

[](#crudmaker)

The CrudMaker commands build a CRUD for a table with unit tests! Use the table-crud for tables that already exist.

```
php artisan crudmaker:new {name or snake_names} {--api} {--ui=bootstrap|semantic} {--serviceOnly} {--withFacade} {--migration} {--schema=} {--relationships=}
php artisan crudmaker:table {name or snake_names} {--api} {--ui=bootstrap|semantic} {--serviceOnly} {--withFacade}
```

Docs
----

[](#docs)

The docs can prepare documentation for business rules or prepare your app for API doc generation with Sami.

```
php artisan laracogs:docs {action} {name=null} {version=null}
```

Facades/ Services
-----------------

[](#facades-services)

Laracogs provides a handful of easy to use tools outside of the app starter kit, and CrudMaker including:

#### Crypto

[](#crypto)

Some simple cryptography tools including a random UUID generator.

```
Crypto::uuid();
Crypto::encrypt('string');
Crypto::decrypt('enc-string');
Crypto::sharable()->encrypt('string');
Crypto::sharable()->decrypt('enc-string');
```

#### FormMaker

[](#formmaker)

Build forms from as little as one line of code.

```
FormMaker::fromTable($table, $columns = null, $class = 'form-control', $view = null, $reformatted = true, $populated = false, $idAndTimestamps = false)
FormMaker::fromObject($object, $columns = null, $view = null, $class = 'form-control', $populated = true, $reformatted = false, $idAndTimestamps = false)
FormMaker::fromArray($array, $columns = null, $view = null, $class = 'form-control', $populated = true, $reformatted = false, $idAndTimestamps = false)
```

#### InputMaker

[](#inputmaker)

Looking to make some inputs? Look no further.

```
InputMaker::label($name, $attributes = [])
InputMaker::create($name, $field, $object = null, $class = 'form-control', $reformatted = false, $populated = false)
```

#### Cerebrum

[](#cerebrum)

A set of traits which can be added to service or models to give your app extra power!

```
Memory // Magical caching
Linguistics // Basic NLP
```

#### Laratest

[](#laratest)

Looking to write tests for your code? Generate test structures with this handy command.

```
php artisan laratest:unit {path to file}
php artisan laratest:route {route}
```

Kits
====

[](#kits)

You may also want to utilize our boilerplate generators, these tools will prepare your apps with starter kits, admins, user settings, notifications, billing integration, API access, Social Media logins, Bootstrap styles and more!
Kits are only compatible with the latest version of Laravel!
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#you-may-also-want-to-utilize-our-boilerplate-generators-these-tools-will-prepare-your-apps-with-starter-kits-admins-user-settings-notifications-billing-integration-api-access-social-media-logins-bootstrap-styles-and-morekits-are-only-compatible-with-the-latest-version-of-laravel)

Starter
-------

[](#starter)

In order to make use of the starter kit you will need to modify some files. Check out the modifications below:

Add the following to your `app/Http/Kernel.php` $routeMiddleware array.

```
'admin' => \App\Http\Middleware\Admin::class,
'permissions' => \App\Http\Middleware\Permissions::class,
'roles' => \App\Http\Middleware\Roles::class,
'active' => \App\Http\Middleware\Active::class,
```

If you want to opt out of having your users confirm their email address, simply remove the `active` from the middleware in the routes files. You may also wish to remove the email notification from `UserService`.

With the roles middleware you can specify which roles are applicable separating them with pipes: `['middleware' => ['roles:admin|moderator|member']]`The permissions middleware allows you to specify which permissions (which are bound to roles) are applicable to a route separating them with pipes: `['middleware' => ['permissions:admin|regular']]`

Update the `App\User::class` in: 'config/auth.php' and 'database/factories/ModelFactory.php' to this:

```
App\Models\User::class
```

Add the following to 'app/Providers/AuthServiceProvider.php' in the boot method

```
Gate::define('admin', function ($user) {
    return ($user->roles->first()->name === 'admin');
});

Gate::define('team-member', function ($user, $team) {
    return ($user->teams->find($team->id));
});

Gate::define('permission', function ($user, $permission) {
    return $user->hasPermission($permission);
});

Gate::define('role', function ($user, $role) {
    return ($user->hasRole($role));
});
```

Add the following to 'app/Providers/EventServiceProvider.php' in the $listen property

```
'App\Events\UserRegisteredEmail' => [
    'App\Listeners\UserRegisteredEmailListener',
],
```

You will want to create an sqlite memory test database in the `config/database.php`

```
'testing' => [
    'driver'   => 'sqlite',
    'database' => ':memory:',
    'prefix'   => '',
],
```

Add the following line to the 'phpunit.xml' file

```

```

##### Regarding Email Activation

[](#regarding-email-activation)

The Starter kit has an email activation component added to the app to ensure your users have validated their email address. You can disable it by removing the `active` middleware from the `web` routes. You will also have to disable the Notification but it won't cause any problems if you remove the email activation.

##### For Laravel 5.2

[](#for-laravel-52)

You will also need to set the location of the email for password reminders. (config/auth.php - at the bottom)

```
'passwords' => [
    'users' => [
        'provider' => 'users',
        'email' => 'emails.password',
        'table' => 'password_resets',
        'expire' => 60,
    ],
],
```

##### Things to note

[](#things-to-note)

You may try and start quickly by testing the registration but please make sure your app's email is configured or it will throw an exception. You can do this in the `.env` file easily by setting it to 'log' temporarily

```
MAIL_DRIVER=log
```

##### Last Steps

[](#last-steps)

Once you've added in all these parts you will want to run the starter command!

```
php artisan laracogs:starter
```

Then you'll need to migrate to add in the users, user meta, roles and teams tables. The seeding is run to set the initial roles for your application.

```
composer dump
php artisan migrate --seed
```

To login simply enter:

```
admin@example.com
admin

```

Once you get the starter kit running you can register and log into your app. You can then visit the settings section of the app and set your role to admin to take full control of the app. Now its time for more boilerplate generators!

### Bootstrap

[](#bootstrap)

---

Bootstrap prepares your application with bootstrap as a view/ css framework.

```
php artisan laracogs:bootstrap
```

### Semantic

[](#semantic)

---

Semantic prepares your application with semantic-ui as a view/ css framework.

```
php artisan laracogs:semantic
```

### Features

[](#features)

---

A powerful and remarkably handy feature management system.

```
php artisan laracogs:feature
```

### Activity

[](#activity)

---

The ability to track user activities and provide a layer of accountability in your app.

```
php artisan laracogs:activity
```

### Socialite

[](#socialite)

---

Socialite prepares your application with a socialite system, with GitHub as the example:

```
php artisan laracogs:socialite
```

### API

[](#api)

---

Api prepares your application with an API system using JWT (logins, and user profile):

```
php artisan laracogs:api
```

Please note that Billing and Notifications are only set for use with bootstrap

### Notifications

[](#notifications)

---

Notifications prepares your application with a notification system.

```
php artisan laracogs:notifications
```

### Billing

[](#billing)

---

The billing command sets up your app with Laravel's cashier - it prepares the whole app to handle subscriptions with a policy structure.

```
php artisan laracogs:billing
```

##### Requires

[](#requires)

```
composer require laravel/cashier
```

You may want to add this line to your navigation:

```
 Billing
```

Add this to the `app/Providers/RouteServiceProvider.php` in the `mapWebRoutes` method. It will look like: `->group(base_path('routes/web.php'));` So you need to change it to resemble this:

```
->group(function () {
    require base_path('routes/web.php');
    require base_path('routes/billing.php');
});
```

This to the .env:

```
SUBSCRIPTION=basic
STRIPE_SECRET=public-key
STRIPE_PUBLIC=secret-key
```

This to the `app/Providers/AuthServiceProvider.php` in the `boot` method:

```
Gate::define('access-billing', function ($user) {
    return ($user->meta->subscribed('main') && is_null($user->meta->subscription('main')->endDate));
});
```

For the `config/services.php` you will want yours to resemble:

```
'stripe' => [
    'model'  => App\Models\UserMeta::class,
    'key'    => env('STRIPE_PUBLIC'),
    'secret' => env('STRIPE_SECRET'),
],
```

Finally run migrate to add the subscrptions and bind them to the user meta:

```
php artisan migrate
```

You will also want to update your gulpfile.js to include the card.js, and subscription.js

```
elixir(function(mix) {
    mix.scripts([
        'app.js',
        'card.js',
        'subscription.js'
    ]);
});
```

#### Accounts (Billing Only)

[](#accounts-billing-only)

##### Plans

[](#plans)

This is the basic config for `config/plans.php`. It sets the default subscription name, as well as the plans and the rules pertaining to them.

```
'subscription_name' => 'main',
'plans' => [
    'basic' => [
        'access' => [
            'some name'
        ],
        'limits' => [
            'Model\Namespace' => 5,
            'pivot_table' => 1
        ],
        'credits' => [
            'column' => 'credits_spent',
            'limit' => 10
        ],
        'custom' => [
            'anything' => 'anything'
        ],
    ],
]

```

##### Service

[](#service)

The service provides extra tools for handling restrictions in your application based on the plan the user subscribed to.

```
getClause('box_limit');
canAccess('area_51');
cannotAccess('restricted_area');
getLimit('team_user');
withinLimit('App\Models\Team');
creditsAvailable('App\Models\Team');
creditsUsed('App\Models\Team');
currentBillingCycle()->withinLimit('App\Models\Team');
clause('custom', function($user, $subscription, $clause, $query) {
    // do your own logic!
    // model is optional if you dont provide it the query is null - otherwise it's a query builder
}, 'App\Models\Team');
```

License
-------

[](#license)

Laracogs is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

### Bug Reporting and Feature Requests

[](#bug-reporting-and-feature-requests)

Please add as many details as possible regarding submission of issues and feature requests

### Disclaimer

[](#disclaimer)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29374282?v=4)[Shabaz Ejaz](/maintainers/shabaz-ejaz)[@shabaz-ejaz](https://github.com/shabaz-ejaz)

### Embed Badge

![Health badge](/badges/shabaz-ejaz-laracogs/health.svg)

```
[![Health](https://phpackages.com/badges/shabaz-ejaz-laracogs/health.svg)](https://phpackages.com/packages/shabaz-ejaz-laracogs)
```

###  Alternatives

[morrislaptop/journal

A UI for Spatie's Laravel Event Sourcing

1734.1k](/packages/morrislaptop-journal)

PHPackages © 2026

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