Модификация моделей
namespace App\Models;
use Pranju\Bitrix24\Models\Crm\Deal;
class NewUser extends Deal
{
protected $connection = 'another_bitrix_connection';
protected $casts = [
'DATECREATE' => 'datetime',
];
public function getIsDeliveryAvailableAttribute(): bool
{
return $this->STGE_ID === 'stage id';
}
}
/** Использование */
$user = $user->where('DATECREATE', '>', now()->subDays(1))->first();
if ($user->is_delivery_available) {
echo 'delivery available';
}Last updated