public function files() {
return $this->hasMany(File::class);
}
public function mod_files() {
return $this->files()->where('type', 'mod');
}
public function index()
{
$mods = Mod::with('categories')
->with('mod_author')
->with('files')
->with('mod_files')
->paginate('10');
return ModResource::collection($mods);
}