<?php

namespace App\Console\Commands;

use App\Models\Project;
use Illuminate\Console\Command;

class BuildReports extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'smartcane:build-reports';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Builds reports for all the projects';

    /**
     * Execute the console command.
     */
    public function handle()
    {
        // TODO schedule all the project if mail
        Project::where(['mail_scheduled' => true])->each(function (Project $project) {
            $project->schedule();
        });
    }
}
