hxnnxs
Black screen in production + canAccessPanel not working
Hello everyone!
Thank you very much for your support❤️.
I rolled back the livewire version to 3.4. Rebuilt the entire project on production.
I wrote the command:
php artisan livewire:publish --assets
(also, according to the documentation, I wrote it in composer.json:
php artisan livewire:publish --assets).
Everything works fine now!
The errors from the console, etc. have disappeared.
But... there is only one problem with canAccessPanel.
The thing is that an unauthorized user can go to the login page
(both locally and in production)
Can you please tell me what this is connected with?
13 replies
Black screen in production + canAccessPanel not working
Hello, thank you for your reply. I clean the cache all the time, but it doesn't help. now I'll try to roll back the livewire version a bit. But I still don't really understand how it doesn't work in production, but everything is fine in the local environment.
13 replies
How to write test for chart widgets or do we need to test chart widgets
Hi, add description for charts: https://filamentphp.com/docs/3.x/widgets/charts#adding-a-description , and here you can see some of the charts : https://filamentphp.com/docs/3.x/widgets/charts. P.S. I hope I understood you correctly 🙂
5 replies
Add button in custom register page
<?php
namespace App\Filament\Pages\Tenancy;
use App\Models\Company;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Pages\Tenancy\RegisterTenant;
use Illuminate\Database\Eloquent\Model;
class RegisterCompany extends RegisterTenant
{
public static function getLabel(): string
{
return 'Create company';
}
public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name')
->required()
->placeholder('FinTrack LTD.')
->minLength(2)
->maxLength(20)
->prefixIcon('heroicon-o-home')
->unique(),
TextInput::make('short_name')
->required()
->prefixIcon('heroicon-o-home')
->placeholder('FT LTD.')
->minLength(2)
->maxLength(10)
->unique(),
Select::make('type')
->required()
->options([
'General' => 'General',
'Simplified' => 'Simplified',
'Patent' => 'Patent'
])
]);
}
protected function handleRegistration(array $data): Company
{
$data['user_id'] = auth()->user()->id;
$company = Company::create($data);
$company->users()->attach(auth()->user());
return $company;
}
}
6 replies
Error when transferring the project to prod: 403FORBIDDEN
Yes, you're right. I missed the moment. But now I have fixed everything, and I am faced with the error that after registration I still have a 403 error, but now I receive an email with verification. But when you click on the verification button, the user is not verified in the DB
15 replies
Error when transferring the project to prod: 403FORBIDDEN
After registration, I get to the page with the creation of the company: http://localhost:8000/dashboard/new , but I get an error .
User.php:
15 replies
SQLSTATE[HY000]: General error: 1364 Field 'tokenable_type' doesn't have a default value
Yes, I'm not negative, I honestly don't know how my translator translates, but I understand that people here are trying to help newcomers like me. And the Api-service plugin : https://filamentphp.com/plugins/rupadana-api-service
7 replies
SQLSTATE[HY000]: General error: 1364 Field 'tokenable_type' doesn't have a default value
Friend, I understand this perfectly well and I understand what I could do with normal Laravel application development, but I use a plugin where it should be automated, I fixed this error, but after this error the plugin cannot find the company id for no reason, although all the connections are present
7 replies
SQLSTATE[HY000]: General error: 1364 Field 'user_id' doesn't have a default value
I'm shocked! I just don't have the words to be honest. The fact is that everything worked fine before migrate:refresh, but after that this error appeared and I tried to fix it for more than 3 hours. Thank you so much for helping such complete beginners in filament like me, you are a pro!❤️
11 replies