updates assets with selected model to inherit asset model eol

This commit is contained in:
Godfrey M 2024-07-10 10:56:44 -07:00
parent 57e1df86c8
commit 09b2feac54
2 changed files with 10 additions and 4 deletions

View file

@ -257,7 +257,7 @@ class LdapSync extends Command
//If a sync option is not filled in on the LDAP settings don't populate the user field
if($ldap_result_username != null){
$user->username = $item['username'];
$user->username = $item[name'];
}
if($ldap_result_last_name != null){
$user->last_name = $item['lastname'];

View file

@ -13,7 +13,7 @@ class RemoveExplicitEols extends Command
*
* @var string
*/
protected $signature = 'snipeit:remove-explicit-eols {--model_name=*}';
protected $signature = 'snipeit:remove-explicit-eols {--model_name=}';
/**
* The console command description.
@ -31,11 +31,17 @@ class RemoveExplicitEols extends Command
if($assetModel){
$assets = Asset::where('model_id', '=', $assetModel->id)->get();
foreach ($assets as $asset) {
$asset->eol_explicit = 0;
$asset->asset_eol_date = null;
$asset->save();
}
$this->info($assets->count().' Assets updated successfully');
}
else {
$this->error('Asset model not found');
}
dd($assets);
}
}