PHPackages                             ikoncept/fabriq - 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. ikoncept/fabriq

Abandoned → [https://github.com/KarabinSE/fabriq](/?search=https%3A%2F%2Fgithub.com%2FKarabinSE%2Ffabriq)Library

ikoncept/fabriq
===============

A CMS Framework by Ikoncept

2.17.0(1mo ago)31.3k↑50%[1 PRs](https://github.com/ikoncept/fabriq/pulls)MITVuePHP ^8.0CI passing

Since Sep 22Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ikoncept/fabriq)[ Packagist](https://packagist.org/packages/ikoncept/fabriq)[ RSS](/packages/ikoncept-fabriq/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (23)Versions (146)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/e70f41efcefb74cac70692bbb98a346495631d491a95a39d8413cc4e97b3e8c7/687474703a2f2f706f7365722e707567782e6f72672f696b6f6e636570742f6661627269712f76)](https://packagist.org/packages/ikoncept/fabriq)[![tests](https://github.com/ikoncept/fabriq/actions/workflows/phpunit.yml/badge.svg)](https://github.com/ikoncept/fabriq/actions/workflows/phpunit.yml)[![PHPStanLevel7](https://github.com/ikoncept/fabriq/actions/workflows/phpStan.yml/badge.svg)](https://github.com/ikoncept/fabriq/actions/workflows/phpStan.yml)[![PHP Version Require](https://camo.githubusercontent.com/d41a16f0f4f2d2205d95a38ac62dc9c76c36fbee642994b578ab7cf700027d56/687474703a2f2f706f7365722e707567782e6f72672f696b6f6e636570742f6661627269712f726571756972652f706870)](https://packagist.org/packages/ikoncept/fabriq)

[![Fabriq CMS logo](https://camo.githubusercontent.com/a787abcba23df2c491ecdeaff0b5644df1e17c23a93cd317be03ba891f401895/68747470733a2f2f6d656469612e6661627269712d636d732e73652f7075626c69632f6661627269712d6f672d696d6167652d313230302e6a7067)](https://camo.githubusercontent.com/a787abcba23df2c491ecdeaff0b5644df1e17c23a93cd317be03ba891f401895/68747470733a2f2f6d656469612e6661627269712d636d732e73652f7075626c69632f6661627269712d6f672d696d6167652d313230302e6a7067)

Fabriq CMS
----------

[](#fabriq-cms)

Installation instructions 💻
---------------------------

[](#installation-instructions-)

Add the customer repository url for the make-user-command in your `composer.json` file:

```
...
    "repositories": {
        "0": {
            "type": "vcs",
            "url": "https://github.com/KarabinSE/laravel-make-user"
        }
    },

```

Install Fabriq:

```
composer require ikoncept/fabriq "^2.0" -W

```

If you're planning on using AWS s3:

```
# Laravel > 9
composer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0"

# Laravel 9+
composer require league/flysystem-aws-s3-v3 "^3.0"
```

Install the Mailgun driver

```
composer require symfony/mailgun-mailer symfony/http-client
```

Install [Laravel Sanctum](https://github.com/laravel/sanctum) as well for authentication

```
composer require laravel/sanctum

```

Add the domain to the `.env` file:

```
SANCTUM_STATEFUL_DOMAINS=your-domain.test
SESSION_DOMAIN=your-domain.test

```

Publish the configurations:

```
php artisan vendor:publish --provider="Ikoncept\Fabriq\FabriqCoreServiceProvider" --tag=config
php artisan vendor:publish --provider="Karabin\TranslatableRevisions\TranslatableRevisionsServiceProvider" --tag=config

```

Setup your database using the .env

Modify the user model 🧘
-----------------------

[](#modify-the-user-model-)

The user model need to extend the Fabriq\\Models\\User::class

```
// app/Models/User.php

//...
use Ikoncept\Fabriq\Models\User as FabriqUser;
//...

class User extends FabriqUser

// ...
```

Run the `fabriq:install` command:

```
php artisan fabriq:install

```

This command will publish front end assets and views. It will also run the migrations

**Important** Delete the files `app.js` and `bootstrap.js` in the `resources/js` directory

```
rm resources/js/app.js && rm resources/js/bootstrap.js

```

Run `pnpm install` and `pnpm production` to build assets

```
pnpm install && pnpm production

```

Auth configuration 🗝
--------------------

[](#auth-configuration-)

### Laravel v11 and above

[](#laravel-v11-and-above)

Note

On Laravel 11 and up the step below is not necessary since the files are overwritten when installing

### Laravel below v11

[](#laravel-below-v11)

Enable the Laravel Sanctum middleware in `app\Http\Kernel.php`

```
    // app\Http\Kernel.php

    /**
     * The application's route middleware groups.
     *
     * @var array
     */
    protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'api' => [
            \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, // forDevProtected();
}, [
    'middleware' => ['auth:sanctum', 'role:dev', 'verified'],
    'prefix' => 'dev'
]);

Fabriq::routes(function ($router) {
    $router->forApiAdminProtected();
}, [
    'middleware' => ['auth:sanctum', 'role:admin', 'verified'],
    'prefix' => 'admin'
]);

Fabriq::routes(function ($router) {
    $router->forApiProtected();
}, [
    'middleware' => ['auth:sanctum']
]);

Fabriq::routes(function ($router) {
    $router->forPublicApi();
});
```

```
// routes/web.php

use Ikoncept\Fabriq\Fabriq;

Fabriq::routes(
    function ($router) {
        $router->allWeb();
    }
);
```

Create your first user in the database, or by using a package like [michaeldyrynda/laravel-make-user](https://github.com/michaeldyrynda/laravel-make-user)

#### Publishing assets 🗄️

[](#publishing-assets-️)

Assets can be published using their respective tags. The tags that are available are:

- `config` - The config file
- `fabriq-translations` - Translations for auth views and validation messages
- `fabriq-frontend-assets` - Front end build system and Vue project files
- `fabriq-views` - Blade views and layouts

You can publish these assets using the command below:

```
php artisan vendor:publish --provider="Ikoncept\Fabriq\FabriqCoreServiceProvider" --tag=the-tag

```

If you want to overwrite your old published assets with new ones (for example when the package has updated views) you can use the `--force` flag

```
php artisan vendor:publish --provider="Ikoncept\Fabriq\FabriqCoreServiceProvider" --tag=fabriq-views --force

```

**Note** *Above tags have been published when the `fabriq:install` was run*

### Broadcasting 📢

[](#broadcasting-)

Fabriq leverages [laravel/echo](https://github.com/laravel/echo) as a front end dependency to communicate with a pusher server. This package is preconfigured to use Ikoncept's own websocket server, but a pusher implementation can be swapped in.

To enable semi automatic prescense broadcasting go to the `/resources/js/plugins/index.js` and un-comment the the line for Laravel Echo:

```
// import '~/plugins/laravel-echo'
import '~/plugins/toast'
import '~/plugins/v-calendar'
import '~/plugins/v-mask'
// ...
```

If the Laravel Echo plugin isn't imported it will not be enabled.

Don't forget to add the proper `.env` variables:

```
BROADCAST_DRIVER=ikoncept_pusher
PUSHER_APP_ID=400
PUSHER_APP_KEY=your-key
PUSHER_APP_SECRET=your-secret
PUSHER_APP_CLUSTER=mt1

```

If you want to have a presence channel for a specific page, simply add it to the route:

```
    {
        path: '/articles/:id/edit',
        name: 'articles.edit',
        component: ArticlesEdit,
        meta: {
            middleware: [RolesMiddleware, PresenceMiddleware], //
