Download the PHP package vi-kon/laravel-utilities without Composer
On this page you can find all versions of the php package vi-kon/laravel-utilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vi-kon/laravel-utilities
More information about vi-kon/laravel-utilities
Files in vi-kon/laravel-utilities
Package laravel-utilities
Short Description Utilities for Laravel 5
License MIT
Homepage https://github.com/vi-kon/laravel-utilities
Informations about the package laravel-utilities
Laravel 5 Utilities
Utilities for Laravel 5. View helpers and other usefull classes.
Table of contents
- Known issues
- Todo
- Changes
- Installation
- Views
- Classes
- Traits
- Middleware
- Helpers
Known issues
None
Back to top
Todo
- Fix incoming bugs
- Finish documentation
Back to top
Changes
Version 2.1
- The Seeder class functionality replaced by ConsoleProgressbar trait
Version 2.0
- Laravel 5 support (requirement)
- Controller class removed (Laravel 5 supports validation via FormRequest classes)
- New middleware features (IsAjax)
- Code optimization with Laravel 5 new features and conventions
Back to top
Installation
Base
To your composer.json
file add following lines:
In your Laravel 5 project add following lines to app.php
:
Middleware
To use middleware class assigned to route need to assign short-hand key to middleware
property of your app/Providers/RouteServiceProvider
class:
Back to top
Views
- html5-layout - HTML 5 layout
Back to top
html5-layout
There are two templates. One for Blade template engine and one for Smarty template engine.
Note: html5-layout.tpl requires Smarty functions implemented in vi-kon/laravel-smarty-view package.
Avalaible blocks / sections:
Name | Description |
---|---|
author | Author metadata |
body | Empty block in body root |
description | Description metadata |
head | Empty block for other head stuff |
scripts | Scripts at after closing body tag |
scripts-head | Empty block to include header scripts |
styles | Empty block to include stylesheets |
title | Page title |
viewport | Viewport meta data |
Block / section definitions:
author
body
description
or
head
or
scripts
or
scripts-head
or
styles
or
title
or
viewport
or
Back to top
Usage
Example "app-layout.tpl"
Back to top
Classes
- Migration - helper methods for database migration
Back to top
Traits
- ConsoleProgressbar - progressbar for console applications
ConsoleProgress trait
This trait help display a progressbar on console:
Output
Usage
Back to top
Middleware
Utilities middleware classes allow different features.
- IsAjax - check if current request is ajax request or not
Back to top
IsAjax middleware
Check if current request is ajax request or not. If request is not ajax request, then throws NotFoundHttpException
exception.
Usage
Back to top
Helpers
Helper functions are shortcuts or aliases for app functions and methods.
- json_response
- view_response
json_response function
json_response
function is alias for new JsonResponse
.
Back to top
License
This package is licensed under the MIT License