Babiute🍎🐍
Babiute🍎🐍
FFilament
Created by Babiute🍎🐍 on 1/26/2024 in #❓┊help
Trying to figure out where this string comes from
Strings come from the component name....
namespace Filament\Pages;

abstract class Page extends BasePage{

public static function getNavigationLabel(): string
{
return static::$navigationLabel ?? static::$title ?? str(class_basename(static::class))
->kebab()
->replace('-', ' ')
->title();
}
}
namespace Filament\Pages;

abstract class Page extends BasePage{

public static function getNavigationLabel(): string
{
return static::$navigationLabel ?? static::$title ?? str(class_basename(static::class))
->kebab()
->replace('-', ' ')
->title();
}
}
3 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
I tried it previously, but for some reason that i really dont remember, it didn't work as expected. I will try this approach again. Thank you again very much for your kindness.
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
I'm using form coz i need somehow, apply some validation to the input. Only when the input is valid, the table data must be filled. Thx for your help man.
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
sure
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
The livewire component
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
1 sec
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
Nobody want to download it to read.. haha
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
😄
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
Its more then 2k letters.. trying to .. its posted as a file but file sux
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
The livewire component has x.blade name. The filament view is named as view-x.blade.
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
Hello man 🙂 A few days ago I decided to translate a code into English. Then the guy who came to offer help threw a bunch of sh** at me, because I made a typo in the name of a variable or something like that i dont remember anymore. I told him that I had translated the code to make it easier to helpers. Then he said to me: Don't translate. Post your code as it is. Note: regarding coding directly in English, I am not authorized. But yes, I can translate the code without any problems, but for the case in question, I think it will be irrelevant.
30 replies
FFilament
Created by Babiute🍎🐍 on 1/3/2024 in #❓┊help
typed property $table must not be accessed before inicialization
1. I made a filament custom pageI have a filament custom. Its function is to render a livewire component:
<?php

namespace App\Filament\Gerencia\Pages\Atendimento;

use App\Enums\Policy;
use App\Models\Solicitacao;
use Filament\Pages\Page;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Facades\Auth;

class ViewRetiraUnidadeArquivamento extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-shopping-cart';

protected static string $view = 'filament.pages.atendimento.view-retira-unidade-arquivamento';

protected static ?int $navigationSort = 3;

protected static ?string $slug = 'atendimento/retirada';

public static function getNavigationLabel(): string
{
return __('Retirar unidade de arquivamento');
}

public function getTitle(): string|Htmlable
{
return __('Retirar unidade de arquivamento');
}

public static function getNavigationGroup(): ?string
{
return __('Atendimento');
}

public static function shouldRegisterNavigation(): bool
{
/** @var \App\Models\Usuario */
$auth = Auth::user();

return $auth->can(Policy::UPDATE->value, Solicitacao::class);
}

public function mount(): void
{
$this->authorize(Policy::UPDATE->value, Solicitacao::class);
}
}
<?php

namespace App\Filament\Gerencia\Pages\Atendimento;

use App\Enums\Policy;
use App\Models\Solicitacao;
use Filament\Pages\Page;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Facades\Auth;

class ViewRetiraUnidadeArquivamento extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-shopping-cart';

protected static string $view = 'filament.pages.atendimento.view-retira-unidade-arquivamento';

protected static ?int $navigationSort = 3;

protected static ?string $slug = 'atendimento/retirada';

public static function getNavigationLabel(): string
{
return __('Retirar unidade de arquivamento');
}

public function getTitle(): string|Htmlable
{
return __('Retirar unidade de arquivamento');
}

public static function getNavigationGroup(): ?string
{
return __('Atendimento');
}

public static function shouldRegisterNavigation(): bool
{
/** @var \App\Models\Usuario */
$auth = Auth::user();

return $auth->can(Policy::UPDATE->value, Solicitacao::class);
}

public function mount(): void
{
$this->authorize(Policy::UPDATE->value, Solicitacao::class);
}
}
2. the respective view:
<x-filament-panels::page>
@livewire('retira-unidade-arquivamento')
</x-filament-panels::page>
<x-filament-panels::page>
@livewire('retira-unidade-arquivamento')
</x-filament-panels::page>
30 replies
FFilament
Created by Babiute🍎🐍 on 12/23/2023 in #❓┊help
Create multiple records at once (pseudo code)
Hey @awcodes Thx for the answer. It is not a custom page. It's a CreateResouce page, but with some customization (meybe would be better to do it in a custom page)? The business rule is: The person can make a Request (this is the model) for a single item. To make life easier for the user, I was asked to create a page where the user could indicate the different items and create 1 request for each item (hence the repeater). There are a few other fields that will be common (for example, the destination and a description). These are handled outside the repeater and used to create each Request.
6 replies
FFilament
Created by Babiute🍎🐍 on 12/23/2023 in #❓┊help
Create multiple records at once (pseudo code)
Someone?
6 replies
FFilament
Created by Babiute🍎🐍 on 12/21/2023 in #❓┊help
How to get name instead of id in a select with relationship
Oh.. I think I made a mistake in the question and wrote too little or the initial question was poorly formulated. the 2nd select will only be enabled if the name of the 1st is "X".. any other selected option must keep the 2nd select disabled. However, the 2nd select options do not use the key/name from the 1st to recover the data in the DB. So, if I set the 'id' of the 2nd dropdown from the 1st using a set, I don't think it would help and I need the name select on the 1st.
7 replies
FFilament
Created by Babiute🍎🐍 on 12/21/2023 in #❓┊help
How to get name instead of id in a select with relationship
@awcodes Sorry, but i didnt understood the tip. 😦
7 replies
FFilament
Created by Babiute🍎🐍 on 12/13/2023 in #❓┊help
Show parents' names in a form, preferably as a link.
Someone? squint
3 replies