Skip to content

Instantly share code, notes, and snippets.

View domthomas-dev's full-sized avatar

Dominique Thomas domthomas-dev

View GitHub Profile
<?php
namespace App\Providers;
use App\Models\Consumer;
use App\Models\Mission;
use App\Models\Product;
use App\Models\Worker;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\ServiceProvider;
<?php
//Enums/ContactType.php
namespace App\Enums;
use App\Enums\Traits\LocalizedEnum;
enum ContactType: string
{
use LocalizedEnum;
<?php
namespace App\Http\Livewire\Traits;
use Illuminate\Support\Str;
trait ConvertEmptyStringsToNull
{
public function updatedConvertEmptyStringsToNull(string $name, mixed $value): void
{
<?php
private function registerTestableLivewireMacro()
{
TestableLivewire::macro('dumpLastErrorBag', function () {
dump($this->lastErrorBag);
return $this;
});
@domthomas-dev
domthomas-dev / DummyApi.php
Created May 28, 2020 09:51
How use Token and prepare External API
<?php
namespace App\Services;
use Illuminate\Http\Client\RequestException;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;