Вход Регистрация
Файл: app/Console/Commands/DeleteReaders.php
Строк: 37
<?php

namespace AppConsoleCommands;

use 
AppModelsReader;
use 
IlluminateConsoleCommand;
use 
SymfonyComponentConsoleCommandCommand as SymfonyCommand;

class 
DeleteReaders extends Command
{
    
/**
     * The name and signature of the console command.
     */
    
protected $signature 'delete:readers';

    
/**
     * The console command description.
     */
    
protected $description 'Delete readers';

    
/**
     * Удаляет старые записи статистики просмотров и скачиваний
     */
    
public function handle(): int
    
{
        
Reader::query()
            ->
where('created_at''<'now()->subMonth())
            ->
delete();

        
$this->info('Readers successfully deleted.');

        return 
SymfonyCommand::SUCCESS;
    }
}
Онлайн: 1
Реклама