PHPackages                             ngmy/okuribito-laravel - 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. ngmy/okuribito-laravel

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

ngmy/okuribito-laravel
======================

OkuribitoLaravel can monitor view loading and record it. This helps to remove unused view files.

0.1.0(6y ago)111MITPHPPHP ^7.1.3CI failing

Since May 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ngmy/okuribito-laravel)[ Packagist](https://packagist.org/packages/ngmy/okuribito-laravel)[ RSS](/packages/ngmy-okuribito-laravel/feed)WikiDiscussions master Synced yesterday

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

OkuribitoLaravel
================

[](#okuribitolaravel)

[![Build Status](https://camo.githubusercontent.com/892db49a286a30efda65702578481340e82c572c5dd9545d319869e901573b62/68747470733a2f2f7472617669732d63692e6f72672f6e676d792f6f6b7572696269746f2d6c61726176656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ngmy/okuribito-laravel)[![Coverage Status](https://camo.githubusercontent.com/332c08344eb5c60b192384a63204fe945a7660c8e738b3284e6ae7841b2c6f57/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e676d792f6f6b7572696269746f2d6c61726176656c2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/ngmy/okuribito-laravel?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/a6fcfd14d9e57356e0447b16a40e7b10004ef56edc6a34b3de9d0d77bfc1876b/68747470733a2f2f706f7365722e707567782e6f72672f6e676d792f6f6b7572696269746f2d6c61726176656c2f762f737461626c65)](https://packagist.org/packages/ngmy/okuribito-laravel)[![Total Downloads](https://camo.githubusercontent.com/f98c83552a615fae0a4ccf6267be6a2b3223118444be775b5ab0e593943a0819/68747470733a2f2f706f7365722e707567782e6f72672f6e676d792f6f6b7572696269746f2d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/ngmy/okuribito-laravel)[![Latest Unstable Version](https://camo.githubusercontent.com/a6a2c5daa0cd332007ddc8374740d0b2bf98ec0c2adbc4caedeb501ab2670b03/68747470733a2f2f706f7365722e707567782e6f72672f6e676d792f6f6b7572696269746f2d6c61726176656c2f762f756e737461626c65)](https://packagist.org/packages/ngmy/okuribito-laravel)[![License](https://camo.githubusercontent.com/da5b21931e3380c96795d480415487a54f333dafc4ac5631172fd8acd9fd96b7/68747470733a2f2f706f7365722e707567782e6f72672f6e676d792f6f6b7572696269746f2d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/ngmy/okuribito-laravel)

OkuribitoLaravel can monitor view loading and record it. This helps to remove unused view files.

This package is inspired by [Ruby's Okuribito gem](https://github.com/shakemurasan/okuribito).

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

[](#requirements)

OkuribitoLaravel has the following requirements:

- PHP &gt;= 7.1.3
- Laravel &gt;= 5.5

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

[](#installation)

Execute the `require` Composer command:

```
composer require ngmy/okuribito-laravel

```

This will update your `composer.json` file and install this package into the `vendor` directory.

### Migration

[](#migration)

Execute the `migrate` Artisan command:

```
php artisan migrate

```

This will create the `view_load_logs` table in your database.

### Publishing Configuration

[](#publishing-configuration)

Execute the `vendor:publish` Artisan command:

```
php artisan vendor:publish

```

This will publish the configuration file to the `config/ngmy-okuribito-laravel.php` file.

You can also use the tag to execute the command:

```
php artisan vendor:publish --tag=ngmy-okuribito-laravel

```

You can also use the service provider to execute the command:

```
php artisan vendor:publish --provider="Ngmy\OkuribitoLaravel\OkuribitoServiceProvider"

```

Basic Usage
-----------

[](#basic-usage)

Update the `config/ngmy-okuribito-laravel.php` file's `monitor_views` option to the view you want to monitor loading:

```
'monitor_views' => 'your.view.foo',
```

You can also specify multiple views:

```
'monitor_views' => [
    'your.view.bar',
    'your.view.baz',
],
```

You can also use a wildcard:

```
'monitor_views' => 'your.view.*',
```

This value is specified in the same format as the first argument of [Laravel's `View::composer` method](https://laravel.com/docs/5.5/views#view-composers).

When the specified view is loaded, it is recorded to the `view_load_logs` table in your database.

You have other options available. See the `config/ngmy-okuribito-laravel.php` file for details.

Advanced Usage
--------------

[](#advanced-usage)

### Customizing Record Method

[](#customizing-record-method)

Creating your implementation of the `ViewLoadLogRepositoryInterface` interface.

```
