<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Http\Controllers\Cache\CacheController;
use Illuminate\Support\Facades\Auth;
class updateCaches extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'command:updateCaches';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Update the caches of several pages on the website';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->line('Logged in: '.(Auth::check() ? 'Yes' : 'No'));
$cacheController = new CacheController();
$this->line('Updating caches... This may take awhile.');
$cacheController->homepage();
$this->line('Updated: homepage');
/*
$cacheController->browseCreations();
$this->line('Updated: browse creations');
$cacheController->radio();
$this->line('Updated: radio');
$cacheController->events();
$this->line('Updated: events');
$this->line('Updating users...');
$count = $cacheController->users();
$this->line('Updated '.$count.' users');
*/
$cacheController->done();
$this->line('Done');
}
}
Comments