2017 © Pedro Peláez
 

library luthier

Improved routing, middleware support, authentication tools and more for CodeIgniter 3 framework

image

luthier/luthier

Improved routing, middleware support, authentication tools and more for CodeIgniter 3 framework

  • Thursday, July 19, 2018
  • by andersonsalas
  • Repository
  • 12 Watchers
  • 38 Stars
  • 826 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 3 Open issues
  • 12 Versions
  • 192 % Grown

The README.md

, (*1)

Luthier CI is an awesome set of core improvements for CodeIgniter 3 that makes the development of APIs (and websites in general) more easy!, (*2)

Features

  • Easy installation via hooks
  • Laravel-like routing: prefixes, namespaces, anonymous functions as routes, route groups, CLI routes, named parameters, optional parameters, etc.
  • Middleware support
  • Authentication library with SimpleAuth template
  • PHP Debug Bar integration (experimental)

Requirements

  • PHP >= 5.6.0 (PHP 7 compatible)
  • CodeIgniter >= 3.0

Installation

Step 1: Get Luthier CI with Composer

composer require luthier/luthier

Step 2: Enable Hooks and Composer autoload

load->view('some_view');
});
```

You can assign names to your routes so you don't have to worry about future url changes:

```php
Route::get('company/about_us', 'testcontroller@index')->name('about_us');
```

To retrieve a named route, use the `route()` function:

```php


If the route has parameters, pass a second argument to the function with an array of their values:, (*3)

<?= route('route_name', ['param1' => 'value2', 'param2' => 'value2' ... ]); ?>

Route Groups

Group routes is possible with the Route::group() method. All routes inside the group will share the prefix (first argument) and, optionally, another property (namespace, middleware, etc.), (*4)

// Prefix only
Route::group('prefix', function(){
    Route::get('bar','test@bar');
    Route::get('baz','test@baz');
});

// Prefix and shared properties
Route::group('prefix', ['namespace' => 'foo', 'middleware' => ['Admin','IPFilter']], function(){
    Route::get('bar','test@bar');
    Route::get('baz','test@baz');
});

Middleware

All the middleware must be defined in the routes files (application/routes/web.php, application/routes/api.php, application/routes/cli.php), (*5)

# Route middleware:
Route::put('foo/bar','controller@method', ['middleware' => ['Test']]);

# Route group middleware:
Route::group('site', ['middleware' => ['Admin']], function(){
    // ...
});

# Global middleware:
Route::middleware('Admin', 'pre_controller');

The middleware files must be saved in the application/middleware folder. If not exists, you must create it first. A middleware file is any php class that implements the Luthier\MiddlewareInterface interface and with a public run() method, which is the entry point. It's strongly advised to name all your middleware with CamelCase and avoid name conflicts with your controllers., (*6)

This is an example of a middleware:, (*7)

<?php
# application/middleware/TestMiddleware.php

class TestMiddleware
{
    public function run()
    {
        // (Entry point)
    }
}

Documentation

Visit the project official website (disponible en español), (*8)

The Versions

19/07 2018

dev-master

9999999-dev https://luthier.ingenia.me/ci/en/

Improved routing, middleware support, authentication tools and more for CodeIgniter 3 framework

  Sources   Download

MIT GPL-3.0

The Requires

 

The Development Requires

middleware codeigniter routing luthier

19/07 2018

v1.0.1

1.0.1.0 https://luthier.ingenia.me/ci/en/

Improved routing, middleware support, authentication tools and more for CodeIgniter 3 framework

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware codeigniter routing luthier

12/07 2018

v1.0.0

1.0.0.0 https://luthier.ingenia.me/ci/en/

Improved routing, middleware support, authentication tools and more for CodeIgniter 3 framework

  Sources   Download

MIT

The Requires

 

middleware codeigniter routing luthier

22/06 2018

v0.3.0

0.3.0.0 https://ingenia.me

Improved routing and middleware support for CodeIgniter framework

  Sources   Download

MIT

The Requires

 

middleware codeigniter routing

09/05 2018

v0.2.1

0.2.1.0 https://ingenia.me

Improved routing and middleware support for CodeIgniter framework

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

  • php >=5.6.0

middleware codeigniter routing

03/05 2018

v0.2.0

0.2.0.0 https://ingenia.me

Improved routing and middleware support for CodeIgniter framework

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

  • php >=5.6.0

middleware codeigniter routing

18/04 2018

v0.1.5

0.1.5.0 https://ingenia.me

Improved routing and middleware support for CodeIgniter framework

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

  • php >=5.6.0

middleware codeigniter routing

15/04 2018

v0.1.4

0.1.4.0 https://ingenia.me

Improved routing and middleware support for CodeIgniter framework

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

  • php >=5.6.0

middleware codeigniter routing

13/04 2018

V0.1.3

0.1.3.0 https://ingenia.me

Improved routing and middleware support for CodeIgniter framework

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

  • php >=5.6.0

middleware codeigniter routing

13/04 2018

v0.1.2

0.1.2.0 https://ingenia.me

Improved routing and middleware support for CodeIgniter framework

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

  • php >=5.6.0

middleware codeigniter routing

09/04 2018

v0.1.1

0.1.1.0 https://ingenia.me

Improved routing and middleware support for CodeIgniter framework

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

  • php >=5.6.0

middleware codeigniter routing

09/04 2018

v0.1.0

0.1.0.0 https://ingenia.me

Improved routing and middleware support for CodeIgniter framework

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

  • php >=5.6.0

middleware codeigniter routing