Files
kaunter/app/Console/Commands/resetRoleDaily.php
2021-02-09 11:25:16 +08:00

47 lines
863 B
PHP

<?php
namespace App\Console\Commands;
use App\User;
use Illuminate\Console\Command;
class resetRoleDaily extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'reset:dailyrole';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Reset Daily Role';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$all_user = User::get();
foreach($all_user as $index=>$user_kaunter){
User::where('id','=',$user_kaunter['id'])->update(['role_harian'=>null]);
}
}
}