1. Go to this page and download the library: Download artflow-studio/starterkit library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// In app/Services/AuthService.php (published with install command)
public static function redirectAfterLogin($user)
{
if ($user->isAdmin()) {
return redirect('/admin/dashboard');
}
if (!$user->email_verified_at) {
return redirect('/email/verify');
}
return redirect('/dashboard');
}
// vendor/artflow-studio/starterkit/src/Providers/StarterKitFortifyServiceProvider.php
public function register(): void
{
// All 20 response contracts are bound here
$this->app->singleton(LoginResponse::class, StarterKitLoginResponse::class);
$this->app->singleton(RegisterResponse::class, StarterKitRegisterResponse::class);
// ... + 18 more
}
public static function redirectAfterLogin(Model $user, ?Request $request = null): string
{
// Check if Spatie is available
if (method_exists($user, 'hasRole')) {
// Admin users
if ($user->hasRole('admin')) {
return '/admin/dashboard';
}
// Moderators
if ($user->hasRole('moderator')) {
return '/moderator/dashboard';
}
// Managers
if ($user->hasRole('manager')) {
return '/manager/dashboard';
}
}
// Default for all other users
return '/dashboard';
}
use ArtflowStudio\StarterKit\Services\AuthService;
use App\Services\AuthService;
// app/Services/AuthService.php
namespace App\Services;
use ArtflowStudio\StarterKit\Services\AuthService as BaseAuthService;
use Illuminate\Database\Eloquent\Model;
class AuthService extends BaseAuthService
{
public static function redirectAfterLogin(Model $user, $request = null): string
{
// Premium users
if ($user->subscription_status === 'premium') {
return '/premium/dashboard';
}
// Fall back to base logic (Spatie roles, etc.)
return parent::redirectAfterLogin($user, $request);
}
}