Skip to content

Instantly share code, notes, and snippets.

View edeoliv's full-sized avatar
:octocat:

Elias Olivtradet edeoliv

:octocat:
View GitHub Profile
@edeoliv
edeoliv / tutorial.php
Created September 4, 2024 13:41 — forked from renatofrota/tutorial.php
Seletor de idioma no Filament 3 com auto-detecção de idioma
<?php
// app/providers/Filament/AdminPanelProvider.php
->spa()
->spaUrlExceptions(['*/lang/*'])
->middleware([SetLang::class])
->renderHook(
name: PanelsRenderHook::USER_MENU_PROFILE_AFTER,
hook: fn (): View => view(view: 'filament.hooks.lang-switcher'),
@edeoliv
edeoliv / FilamentServiceProvider.php
Created September 3, 2024 03:30 — forked from saade/FilamentServiceProvider.php
My Filament Defaults
<?php
namespace App\Providers;
use Filament\Actions;
use Filament\Forms;
use Filament\Infolists;
use Filament\Notifications\Notification;
use Filament\Pages;
use Filament\Support\Enums\MaxWidth;
@edeoliv
edeoliv / chatbox.blade.php
Created August 16, 2024 21:50 — forked from tuto1902/chatbox.blade.php
Livewire Chat Box Component
<?php
use App\Events\MessageSent;
use Livewire\Volt\Component;
new class extends Component
{
/**
* @var string[]
*/
@edeoliv
edeoliv / settings.json
Created August 16, 2024 17:58
vs code settings
{
"workbench.iconTheme": "symbols",
"git.autofetch": true,
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [80],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
@edeoliv
edeoliv / footer.blade.php
Created May 10, 2024 09:36
footer for orders status chart widget
@edeoliv
edeoliv / OrderStatus.php
Created May 10, 2024 09:34
OrderStatus
<?php
declare(strict_types=1);
namespace App\Enums;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;
@edeoliv
edeoliv / OrderStatusChart.php
Created May 10, 2024 09:22
OrderStatusChart
<?php
namespace App\Filament\Widgets;
use App\Models\Order;
use Illuminate\View\View;
use App\Enums\OrderStatus;
use Leandrocfe\FilamentApexCharts\Widgets\ApexChartWidget;
class OrderStatusChart extends ApexChartWidget
@edeoliv
edeoliv / example.php
Created January 25, 2024 03:05
Count how many characters left to type in the field in filamentphp
<?php
//Simple, based on field max length
Textarea::make('content')
->hint(fn ($state, $component) => 'left: ' . $component->getMaxLength() - strlen($state) . ' characters')
->maxlength(10)
->lazy() //or: reactive() for instant update, but less efficient
@edeoliv
edeoliv / PasswordAction.php
Created January 24, 2024 06:42
Password confirmation action
<?php
namespace App\Filament\Actions;
use Filament\Forms;
use Filament\Pages\Actions\Action;
class PasswordAction extends Action
{
protected function isPasswordSessionValid()
@edeoliv
edeoliv / base64-image-view.blade.php
Created December 29, 2023 09:08
View base64-image-view
<div>
<div class="p-1 drop-shadow-sm" style="width: 1rem;">
{!! $getRecord()->qr_code !!}
</div>
</div>