π On Production
Deploying this project to production follows all Laravel recommendations. However, since this app is built with Filament, a few extra steps are required.
π Error 403 β Access Denied
If you encounter a 403 Forbidden error when trying to access the admin panel in production, follow these steps to resolve it:
β οΈ Important:
- Ensure you have a strong password for your application.
- This error typically occurs if you haven't configured your User Model to grant access to Filament in a non-local environment.
β
Solution: Implement the FilamentUser
Contract
To allow access to Filament, you must update your User
model to implement the FilamentUser
contract:
<?php
namespace App\Models;
use Filament\Models\Contracts\FilamentUser;
use Filament\Panel;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable implements FilamentUser
{
// ...
public function canAccessPanel(Panel $panel): bool
{
return str_ends_with($this->email, '@yourdomain.com') && $this->hasVerifiedEmail();
}
}
You can find this information in the Filament Documentation.
π― Faker on Production
By default, Faker is a dependency used only in development environments to generate fake data for testing. However, Warriorfolio relies on Seeders to populate certain data, which may require Faker even in production.
If your app throws an error related to Faker during seeding or installation in production, follow these steps:
β How to Install Faker in Production
Run the following command:
composer require fakerphp/faker
π Why is This Necessary?
Although Faker is typically a development-only dependency, Warriorfolio uses it in some Seeders to generate sample content. If you're running seeders on your production server, installing Faker ensures the app works correctly.
If you don't need to generate sample content in production, you can comment out any seeders that use Faker before running the seeding command.
βοΈ on Laravel Cloud
You can easily deploy Warriorfolio on Laravel Cloud β the official cloud platform for deploying and managing Laravel applications.
With Laravel Cloud, you can deploy your app with just a few commands, without worrying about server configurations. The platform automatically manages infrastructure, security, and scalability for your application.
π₯ All you need to do is push your project to GitHub or GitLab, connect your repository to Laravel Cloud, and it will handle the rest β including domain setup, SSL certificates, and automated deployments.