PHPackages                             rosengate/sigil - 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. [API Development](/categories/api)
4. /
5. rosengate/sigil

ActiveLibrary[API Development](/categories/api)

rosengate/sigil
===============

Laravel-Exedra PHP 8 attributes based routing controller package

v0.0.7(11mo ago)276MITPHP

Since Apr 8Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/Rosengate/sigil)[ Packagist](https://packagist.org/packages/rosengate/sigil)[ RSS](/packages/rosengate-sigil/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

Sigil
=====

[](#sigil)

Laravel-Exedra PHP 8 attributes based routing controller package

Table of Contents
=================

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Setup](#setup)
- [Basic Usages](#usages)
- [Routing Conventions](#conventions)
- [Routing Attributes](#attributes)
- [Sub-routing / Group](#group)
- [Middlewares](#middlewares)
    - [Global middlewares](#global-middlewares)
    - [Group based middlewares](#group-middlewares)
    - [Method based middlewares](#method-middlewares)
- [Meta Information](#meta)
    - [State](#state)
    - [Series](#series)
    - [Flag](#flag)
    - [Usages of Meta Information](#meta-usages)
    - [Make your own attributes](#make-attributes)
- [DI Method Injection](#method-injection)
- [Utilities](#utilities)
    - [Route Model](#route-model)
    - [PHPLeague Transformer](#transformer)
    - [Renderer](#renderer)
- [Console Commands](#console)
- [Todos](#todos)
- [Drawbacks](#drawbacks)
- [Feedbacks](#feedbacks)
- [Why](#why)
- [License](#license)

 Features
---------------------------------------------

[](#-features)

- Couple your routing with the controller class
- PHP 8 attributes based routing component
- Nested routing
- Provide a flexible ways to control/design your application through means like :
    - sub-routing based middleware
    - meta information
    - create your own attributes, and control it through your own middleware

 Requirements
-----------------------------------------------------

[](#-requirements)

- Laravel
- PHP &gt;= 8
- this packages overrides your laravel Http Kernel and wholly use routing/controller/middleware component from `rosengate/exedra`, however it still fallbacks to laravel routes when there's no matching routes.

 Setup
---------------------------------------

[](#-setup)

#### 1. Install package through composer

[](#1-install-package-through-composer)

For Laravel 10 and below

```
composer require rosengate/sigil

```

For laravel 11 onwards

```
composer require psr/http-message ^1.1
composer require rosengate/sigil

```

#### 2. Register `Sigil\Providers\SigilProvider`

[](#2-register-sigilproviderssigilprovider)

Register `Sigil\Providers\SigilProvider` inside your `bootstrap/providers.php`

```
    /*
     * Package Service Providers...
     */
    SigilProvider::class
```

#### 3. publish and cache the config

[](#3-publish-and-cache-the-config)

Publish initial sigil.php files, and all the controllers, middlewares, and attributes.

```
php artisan vendor:publish --provider=Sigil\Providers\SigilProvider

```

Config cache after publishing the providers

```
php artisan config:cache

```

#### 4. Http Kernel Extension

[](#4-http-kernel-extension)

Since this package interact changes at http level, sigil does it's own bridging through Laravel Http Kernel.

For laravel 10 and below, extend your `App\Http\Kernel` with `Sigil\SigilKernel` (as this package uses it's own routing and request dispatch).

```
