Laravel 11 - Workgroup Project

Laravel 11 - Workgroup Project

[1] Create project

laraworkgroup

composer create-project laravel/laravel:11.0.0 laraworkgroup --prefer-dist

[2] Setup Breeze

[2.1] Get Breeze Package

composer require laravel/breeze:2.0.3

[2.2] Install Breeze Package

php artisan breeze:install

output:

Which Breeze stack would you like to install? 
Blade with Alpine 
❯ blade blade

Would you like dark mode support? 
(yes/no) [no] 
❯ no

Which testing framework do you prefer? 
[PHPUnit] 
❯ 1

...
vite v5.2.11 building for production...

[2.3] Enable Email Verification

(File: C:\laragon\www\laraworkgroup\app\Models\User.php)

  1. Uncomment use Illuminate\Contracts\Auth\MustVerifyEmail;

  2. Add implements MustVerifyEmail to the class declaration

Full code:

<?php

namespace App\Models;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable implements MustVerifyEmail
{
    use HasFactory, Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array<int, string>
     */
    protected $fillable = [
        'name',
        'email',
        'password',
    ];

    /**
     * The attributes that should be hidden for serialization.
     *
     * @var array<int, string>
     */
    protected $hidden = [
        'password',
        'remember_token',
    ];

    /**
     * Get the attributes that should be cast.
     *
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'email_verified_at' => 'datetime',
            'password' => 'hashed',
        ];
    }
}

[2.4] Apply changes

Database migration:

php artisan migrate

Frontend:

npm install
npm run build

[2.5] Test

Register.

Login.

Download example:

https://archive.org/download/laravelprojects/laraworkgroup_lara11breeze2-0-3_20240504.zip