/**
* @return array[]
*/
- public static function getData($force=false)
+ public static function getData($force = false)
{
if ($force || static::$_data === null) {
static::$_data = static::_getData();
return [];
}
- public static function refreshDatabase($force=false)
+ public static function refreshDatabase($force = false)
{
$hadError = false;
$instance = (new static);
- $listAllInDb = static::all();
+ $listAllInDb = static::withoutGlobalScopes()->get();
$pk = $instance->getPrimaryKey();
$existingKeys = [];
foreach ($listAllInDb as $item) {
Log::error($e);
}
- static::whereIn($pk, $toDelete)->delete();
+ static::whereIn($pk, $toDelete)->forceDelete();
Cache::put(static::getCacheKey() . '_refresh', $hadError ? -1 : time());
}