PHPackages                             vi-kon/laravel-utilities - 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. vi-kon/laravel-utilities

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

vi-kon/laravel-utilities
========================

Utilities for Laravel 5

v2.2.0(11y ago)031.2k↓41.7%MITPHPPHP &gt;=5.3.0

Since May 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/vi-kon/laravel-utilities)[ Packagist](https://packagist.org/packages/vi-kon/laravel-utilities)[ Docs](https://github.com/vi-kon/laravel-utilities)[ RSS](/packages/vi-kon-laravel-utilities/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (14)Used By (0)

Laravel 5 Utilities
===================

[](#laravel-5-utilities)

Utilities for **Laravel 5**. View helpers and other usefull classes.

Table of contents
-----------------

[](#table-of-contents)

- [Known issues](#known-issues)
- [Todo](#todo)
- [Changes](#changes)
- [Installation](#installation)
- [Views](#views)
- [Classes](#classes)
- [Traits](#traits)
- [Middleware](#middleware)
- [Helpers](#helpers)

Known issues
------------

[](#known-issues)

None

---

[Back to top](#laravel-5-parser-and-lexer)

Todo
----

[](#todo)

- Fix incoming bugs
- Finish documentation

---

[Back to top](#laravel-5-parser-and-lexer)

Changes
-------

[](#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](#laravel-5-parser-and-lexer)

Installation
------------

[](#installation)

### Base

[](#base)

To your `composer.json` file add following lines:

```
// to your "require" object
"vi-kon/laravel-utilities": "2.*"
```

In your Laravel 5 project add following lines to `app.php`:

```
// to your providers array
'ViKon\Utilities\UtilitiesServiceProvider',
```

Middleware
----------

[](#middleware)

To use middleware class assigned to route need to assign short-hand key to `middleware` property of your `app/Providers/RouteServiceProvider` class:

```
// to your middleware array
'ajax' => 'ViKon\Utilities\Middleware\IsAjax',
```

---

[Back to top](#laravel-5-parser-and-lexer)

Views
-----

[](#views)

- [html5-layout](#html5-layout) - HTML 5 layout

---

[Back to top](#laravel-5-parser-and-lexer)

### html5-layout

[](#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:

[](#avalaible-blocks--sections)

NameDescription**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 dataBlock / section definitions:

##### author

[](#author)

```

```

```

```

##### body

[](#body)

```

    @yield('body')

```

```

    {block name="body"}{/block}

```

##### description

[](#description)

```

```

or

```

```

##### head

[](#head)

```

    @yield('head')

```

or

```

    {block name="head"}{/block}

```

##### scripts

[](#scripts)

```

    @yield('scripts')

```

or

```

    {block name="scripts"}{/block}

```

##### scripts-head

[](#scripts-head)

```

    @yield('scripts-head')

```

or

```

    {block name="scripts-head"}{/block}

```

##### styles

[](#styles)

```

    @yield('styles')

```

or

```

    {block name="styles"}{/block}

```

##### title

[](#title)

```

@yield('title', 'HTML 5 Layout')

```

or

```

{block name="title"}HTML 5 Layout{/block}

```

##### viewport

[](#viewport)

```

    @section('viewport')

    @show

```

or

```

    {block name="viewport"}

    {/block}

```

---

[Back to top](#laravel-5-parser-and-lexer)

#### Usage

[](#usage)

##### Example "app-layout.tpl"

[](#example-app-layouttpl)

```
{extends file="view:utilities::html5-layout"}

{block name="title"}{strip}
    {lang}app.title{/lang}
{/strip}{/block}

{block name="description"}{strip}
    {lang}app.description{/lang}
{/strip}{/block}

{block name="styles"}{strip}
    {html_style _url="vendor/bootstrap/css/bootstrap.min.css"}
    {html_style _url="vendor/bootstrap-tokenfield/bootstrap-tokenfield.min.css"}
{/strip}{/block}

{block name="scripts-head" append}{strip}
    {html_script _url="vendor/jquery/jquery-2.1.0.min.js"}
    {html_script _url="vendor/bootstrap/js/bootstrap.min.js"}
    {html_script _url="vendor/bootstrap-tokenfield/bootstrap-tokenfield.min.js"}
{/strip}{/block}

{block name="scripts" append}{strip}
    {html_script _url="js/bootstrap-setup.js"}
{/strip}{/block}

{block name="body"}{strip}

        {* Page menu *}

                    {lang}app.header.title{/lang}
                    {lang}app.header.title-lead{/lang}

                {if $user !== null}

                        {$user['username']}
                        &nbsp;|&nbsp;

                            {lang}app.header.btn.settings{/lang}

                        &nbsp;|&nbsp;
                        {lang}app.header.btn.logout{/lang}

                {/if}

        {* Block container for subpage content *}
        {block name="container"}{/block}

{/strip}{/block}
```

---

[Back to top](#laravel-5-parser-and-lexer)

Classes
-------

[](#classes)

- [Migration](#migrationclass) - helper methods for **database migration**

---

[Back to top](#laravel-5-parser-and-lexer)

Traits
------

[](#traits)

- [ConsoleProgressbar](#consoleprogressbartrait) - progressbar for console applications

### ConsoleProgress trait

[](#consoleprogress-trait)

This trait help display a progressbar on console:

**Output**

```
############--------------------------------------  24.54% (124,752/508,331)
```

**Usage**

```
// Initialize progressbar
$this->initProgressbar();
// Reset progress and output a message
$this->startProgress('Seed agt_agent_types table');
// Set progressbar elements
$this->setProgressMax(12);

// ...

// Make step in progressbar
$this->progress();
```

---

[Back to top](#laravel-5-parser-and-lexer)

Middleware
----------

[](#middleware-1)

Utilities middleware classes allow different features.

- [IsAjax](#isajax-middleware) - check if current request is ajax request or not

---

[Back to top](#laravel-5-parser-and-lexer)

### IsAjax middleware

[](#isajax-middleware)

Check if current request is ajax request or not. If request is not ajax request, then throws `NotFoundHttpException` exception.

#### Usage

[](#usage-1)

```
$options = [
    'middleware' => 'ajax',
];
Route::get('URL', $options);
```

---

[Back to top](#laravel-5-parser-and-lexer)

Helpers
-------

[](#helpers)

Helper functions are shortcuts or aliases for app functions and methods.

- [json\_response](#json_response-function)
- [view\_response](#view_response-function)

### json\_response function

[](#json_response-function)

`json_response` function is alias for `new JsonResponse`.

---

[Back to top](#laravel-5-parser-and-lexer)

License
-------

[](#license)

This package is licensed under the MIT License

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~31 days

Recently: every ~43 days

Total

12

Last Release

4036d ago

Major Versions

v1.0.4 → 4.1.x-dev2014-07-20

v1.0.5 → 4.2.x-dev2014-11-08

v1.0.6 → v2.0.02015-03-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/97ac6badd847093e56369390bf36ddbb8740e10a8a495b339c2adb78e7345663?d=identicon)[vincekovacs](/maintainers/vincekovacs)

---

Top Contributors

[![vincekovacs](https://avatars.githubusercontent.com/u/1031595?v=4)](https://github.com/vincekovacs "vincekovacs (43 commits)")

---

Tags

laravelutilities

### Embed Badge

![Health badge](/badges/vi-kon-laravel-utilities/health.svg)

```
[![Health](https://phpackages.com/badges/vi-kon-laravel-utilities/health.svg)](https://phpackages.com/packages/vi-kon-laravel-utilities)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[livewire/flux

The official UI component library for Livewire.

9475.0M86](/packages/livewire-flux)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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