This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Eloquent\Concerns; | |
use Illuminate\Database\Eloquent\Model as IlluminateModel; | |
use Illuminate\Support\Arr; | |
use Vinkla\Hashids\Facades\Hashids; | |
trait HasHashId | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Carbon\Carbon; | |
use Carbon\CarbonPeriod; | |
use Illuminate\Support\Collection; | |
$period = collect(CarbonPeriod::since(Carbon::parse('-1year'))->days(1)->until(Carbon::now())) | |
->concat(CarbonPeriod::since(Carbon::parse('-1week'))->hours(1)->until(Carbon::now())) | |
->concat(CarbonPeriod::since(Carbon::parse('-1day'))->minutes(30)->until(Carbon::now())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\PHPStan\Rules; | |
use Illuminate\Database\Eloquent\Builder as EloquentBuilder; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Database\Query\Builder; | |
use Illuminate\Support\Facades\DB; | |
use PhpParser\Node; | |
use PhpParser\Node\Expr\MethodCall; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Exceptions; | |
use ArrayIterator; | |
use Closure; | |
use Countable; | |
use Exception; | |
use Illuminate\Support\Collection; | |
use IteratorAggregate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Asserts; | |
use App\Domain\Stock\Enum\StocktakingStatus; | |
use App\Domain\Stock\Resource\StorageBatchResource; | |
use Carbon\Carbon; | |
use DateTimeInterface; | |
use Illuminate\Testing\Fluent\AssertableJson; | |
use OutOfBoundsException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function number2words(int $number): string | |
{ | |
if ($number < 20) { | |
return ones2words($number); | |
} elseif ($number < 100) { | |
return tens2words($number); | |
} elseif ($number < 1000) { | |
return hundreds2words($number); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace JustSteveKing\Transporter; | |
use Illuminate\Http\Client\PendingRequest; | |
class CreateTodoRequest extends Request | |
{ | |
protected string $method = 'POST'; | |
protected string $baseUrl = 'https://jsonplaceholder.typicode.com'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Eloquent\Concerns; | |
use Illuminate\Database\Eloquent\Model as IlluminateModel; | |
use Illuminate\Support\Arr; | |
use Vinkla\Hashids\Facades\Hashids; | |
trait HasHashId | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {registerRoute} from 'workbox-routing'; | |
import {StaleWhileRevalidate} from 'workbox-strategies'; | |
import {CacheableResponsePlugin} from 'workbox-cacheable-response'; | |
import {CacheFirst} from 'workbox-strategies'; | |
import {ExpirationPlugin} from 'workbox-expiration'; | |
self.addEventListener("message", (event) => { | |
if (event.data && event.data.type === "SKIP_WAITING") { | |
self.skipWaiting(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clear system caches | |
sudo rm -rf /Library/Caches/* | |
sudo rm -rf /System/Library/Caches/* | |
sudo rm -rf ~/Library/Caches/* | |
# clear dns cache | |
sudo dscacheutil -flushcache | |
sudo killall -HUP mDNSResponder | |
# clear google chrome cache |