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\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\RedirectResponse; | |
use Illuminate\Http\Request; | |
class Localized | |
{ |
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 | |
class Car extends Model | |
{ | |
public function users() | |
{ | |
return $this->belongsToMany(User::class, 'car_user_role') | |
->using(CarUserRole::class) | |
->withPivot('role_id', 'user_id', 'car_id'); | |
} |
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; | |
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; | |
use JMac\Testing\Traits\HttpTestAssertions; | |
use Tests\Utils\CreateUploadedFileFromFilePath; | |
use Tests\Utils\IsRoutesAware; | |
use Tests\Utils\ResourceAsserts; |
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\Http\Controllers\Auth; | |
use App\Http\Controllers\Concerns\ThrottlesRequests; | |
use App\Http\Requests\Auth\SignInRequest; | |
use App\Http\Requests\Auth\SignUpRequest; | |
use App\Models\User; | |
use Illuminate\Auth\Events\Registered; | |
use Illuminate\Http\RedirectResponse; |
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
class IpAddress | |
{ | |
public string $ip; | |
public function __construct(string $ip) | |
{ | |
$this->ip = $ip; | |
} | |
public function __toString(): string |
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 |
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
<?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 | |
namespace JustSteveKing\Transporter; | |
use Illuminate\Http\Client\PendingRequest; | |
class CreateTodoRequest extends Request | |
{ | |
protected string $method = 'POST'; | |
protected string $baseUrl = 'https://jsonplaceholder.typicode.com'; |