mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 12:09:02 -05:00
Merge pull request #2676 from Roardom/fix-all-pluck
(Refactor) Reduce unnecessary collection calls
This commit is contained in:
@@ -43,7 +43,7 @@ class AutoHighspeedTag extends Command
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$seedboxIps = Seedbox::all()->pluck('ip')->filter(fn ($ip) => filter_var($ip, FILTER_VALIDATE_IP));
|
||||
$seedboxIps = Seedbox::pluck('ip')->filter(fn ($ip) => filter_var($ip, FILTER_VALIDATE_IP));
|
||||
|
||||
Torrent::withAnyStatus()
|
||||
->leftJoinSub(
|
||||
|
||||
@@ -177,7 +177,7 @@ class AnnounceController extends Controller
|
||||
), new TrackerException(121));
|
||||
|
||||
// Block Blacklisted Clients
|
||||
$clientBlacklist = cache()->rememberForever('client_blacklist', fn () => BlacklistClient::all()->pluck('name')->toArray());
|
||||
$clientBlacklist = cache()->rememberForever('client_blacklist', fn () => BlacklistClient::pluck('name')->toArray());
|
||||
throw_if(
|
||||
\in_array($userAgent, $clientBlacklist),
|
||||
new TrackerException(128, [':ua' => $request->header('User-Agent')])
|
||||
|
||||
@@ -53,7 +53,7 @@ class GroupController extends Controller
|
||||
{
|
||||
$group = Group::create(['slug' => Str::slug($request->name)] + $request->validated());
|
||||
|
||||
foreach (Forum::all()->pluck('id') as $collection) {
|
||||
foreach (Forum::pluck('id') as $collection) {
|
||||
$permission = new Permission();
|
||||
$permission->forum_id = $collection;
|
||||
$permission->group_id = $group->id;
|
||||
|
||||
Reference in New Issue
Block a user