PHP code example of ngmy / okuribito-laravel

1. Go to this page and download the library: Download ngmy/okuribito-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ngmy / okuribito-laravel example snippets


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

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

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


declare(strict_types=1);

namespace Your\Namespace;

use Ngmy\OkuribitoLaravel\Domain\Model\View\View;
use Ngmy\OkuribitoLaravel\Domain\Model\ViewLoadLog\ViewLoadLog;
use Ngmy\OkuribitoLaravel\Domain\Model\ViewLoadLog\ViewLoadLogRepositoryInterface;

class YourViewLoadLogRepository implements ViewLoadLogRepositoryInterface
{
    public function existsByView(View $view): bool
    {
        // Implement your existsByView() method here
    }

    public function save(ViewLoadLog $log): void
    {
        // Implement your save() method here
    }
}

$this->app->bind(
    \Ngmy\OkuribitoLaravel\Domain\Model\ViewLoadLog\ViewLoadLogRepositoryInterface::class,
    \Your\Namespace\YourViewLoadLogRepository::class
);

php artisan migrate

php artisan vendor:publish

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

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