...
 
Commits (3)
......@@ -101,9 +101,6 @@ class RefreshShow
$feed->last_refresh = Carbon::now();
$feed->save();
// Laravel overwrites ID on save
$feed->id = (int)$response['id'];
}
protected function extractSeasons(\SimpleXMLElement $response): array
......@@ -154,9 +151,6 @@ class RefreshShow
$changed = true;
$item->save();
// Laravel overwrites ID on save
$item->id = $id;
}
return $changed;
......
......@@ -7,6 +7,13 @@ use Illuminate\Support\Carbon;
class Feed extends Model
{
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
/**
* The attributes that are mass assignable.
*
......
......@@ -7,6 +7,13 @@ use Illuminate\Support\Carbon;
class Item extends Model
{
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
/**
* The attributes that are mass assignable.
*
......@@ -43,14 +50,12 @@ class Item extends Model
$this->attributes['itunes_duration'] = $duration;
}
public function getPubDateAttribute($pub_date)
protected function asDateTime($value)
{
$date = date_create($pub_date);
if (!$date) {
$date = new \DateTime('@0');
try {
return parent::asDateTime($value);
} catch (\InvalidArgumentException $e) {
return Carbon::make('@0');
}
return Carbon::instance($date);
}
}
This diff is collapsed.