mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 20:44:03 +00:00
8a28eb1790
This reverts merge request !5
35 lines
744 B
PHP
35 lines
744 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
class ClearCache {
|
|
/** @var Application */
|
|
private $application;
|
|
|
|
/**
|
|
* @param Application $application
|
|
*/
|
|
public function __construct(Application $application) {
|
|
$this->application = $application;
|
|
}
|
|
|
|
/**
|
|
* @param $request
|
|
* @param Closure $next
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next) {
|
|
// only run view:clear if we're not on production
|
|
if ($this->application->environment() !== 'production') {
|
|
Artisan::call('view:clear');
|
|
}
|
|
|
|
return $next($request);
|
|
}
|
|
}
|