Skip to content

Instantly share code, notes, and snippets.

@BataBoom
BataBoom / gist:06942536e83c3ab05af3176760b7c903
Last active January 6, 2024 01:53
Livewire V3 Pagination w/ Multiple Models
<?php
namespace App\Http\Livewire\Paginate;
use Livewire\Component;
use Livewire\Attributes\Validate;
use Livewire\Attributes\Locked;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Cache;
use Illuminate\Database\Eloquent\Collection;
@BataBoom
BataBoom / espn-api-list.md
Created September 5, 2023 20:30 — forked from nntrn/espn-api-list.md
list of nfl api endpoints from espn

List of NFL API Endpoints

This page has been updated a lot in the past 2 years.

Older revisions you might like more than this one:

  • June 2021 - list of [ESPN endpoints for other sports/leagues][espn_api_leagues] (basketball, baseball, MMA, lacrosse, rugby)
  • August 2021 - historical fantasy data and notes on combining views
  • September 2021 - [source.txt][source_txt] file listing all endpoints
  • December 2021 - data response preview for endpoints
@BataBoom
BataBoom / updateWinnerBalances.php
Last active February 7, 2022 07:40
Array_filter vs foreach/loop
$matchU = array_values(array_column($winners, 'userID'));
$matchAmT = array_values(array_column($winners, 'amount'));
$count = count($matchU);
/* Method 1: for loop + foreach (identical result, preserves keys =[ )*/
for ($n = 0; $n < $count; ++$n){
if ($winners[$n]['userID'] === $matchU[$n]){
$new[$matchU[$n]][$n] = array($matchAmT[$n]);
}