PHP code example of darkghosthunter / laraload

1. Go to this page and download the library: Download darkghosthunter/laraload 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/ */

    

darkghosthunter / laraload example snippets




return [
    'enable' => env('LARALOAD_ENABLE'),
    'condition' => \DarkGhostHunter\Laraload\Conditions\CountRequests::class,
    'output' =>  storage_path('preload.php'),
    'memory' => 32,
    'use_



return [
    'enable' => env('LARALOAD_ENABLE'),
];



return [
    'condition' => 'App\MyCustomCondition@handle',
];



return [
    'output' => '/var/www/preloads/my_preload.php',
];



return [
    'memory' => 64,
];



return [
    'use_ath('vendor/autoload.php'),
];



return [
    'ignore-not-found' => true,
];


use Symfony\Component\Finder\Finder;
use Illuminate\Support\ServiceProvider;
use DarkGhostHunter\Laraload\Facades\Laraload;

class AppServiceProvider extends ServiceProvider
{
    // ...
    
    public function boot()
    {
        Laraload::append(function (Finder $find) {
            $find->in('www/app/vendor/name/package/src')->name('*.php');
        });
        
        Laraload::exclude(function (Finder $find) {
            $find->in('www/app/resources/views')->name('*.blade.php');
        });
    }
}

$this->app->when(\DarkGhostHunter\Laraload\Conditions\CountRequests::class)
     ->needs('$hits')
     ->give(1500);
ini
opcache.preload = 'www/app/storage/preload.php';
bash
php artisan vendor:publish --provider="DarkGhostHunter\Laraload\LaraloadServiceProvider"