Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a7014f8
laravel install
JonathanRixhon Apr 27, 2026
566f85b
Update user to customer to fit the database structure
JonathanRixhon Apr 27, 2026
2b69f72
Update factory name on customer model
JonathanRixhon Apr 27, 2026
0627fa6
Update custom user to be able to login
JonathanRixhon Apr 27, 2026
9fe489c
Add some views for the order form
JonathanRixhon Apr 27, 2026
119d650
Add Login system and beginning of the order one
JonathanRixhon Apr 27, 2026
f23550f
add Create user command
JonathanRixhon Apr 27, 2026
9385b6a
update order form and request validation
JonathanRixhon Apr 28, 2026
df70884
change ligin form title
JonathanRixhon Apr 28, 2026
43cd3bc
add basic order
JonathanRixhon Apr 28, 2026
4ac0cf0
Create discount system
JonathanRixhon Apr 28, 2026
7dd6e96
Add permium discount and set hards limit
JonathanRixhon Apr 28, 2026
5ee8e72
Add order success page
JonathanRixhon Apr 28, 2026
14e71bc
add mail system
JonathanRixhon Apr 28, 2026
e3dbad0
add basic scss
JonathanRixhon Apr 28, 2026
43cb360
update some css
JonathanRixhon Apr 28, 2026
c5ad629
Add tests and fix password for seeder
JonathanRixhon Apr 29, 2026
6f1c08b
fix discount manager to avoid editing 2 times the price
JonathanRixhon Apr 29, 2026
5ac2b0a
change the discount mechanism to track of the total percentage
JonathanRixhon Apr 29, 2026
e7d40a2
add order tests with the new percentage system
JonathanRixhon Apr 29, 2026
0b4722e
Update login-form.blade.php
JonathanRixhon Apr 29, 2026
1ad16bc
add error when no item at all
JonathanRixhon Apr 29, 2026
e656e0e
Update .env.example
JonathanRixhon Apr 29, 2026
8c6834b
queue mail
JonathanRixhon Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[{compose,docker-compose}.{yml,yaml}]
indent_size = 4
65 changes: 65 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
APP_NAME="Developer Test"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://developer-test.test

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database

# PHP_CLI_SERVER_WORKERS=4

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=root
DB_PASSWORD=

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

CACHE_STORE=database
# CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME="${APP_NAME}"
20 changes: 20 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
APP_NAME="Developer Test"
APP_ENV=testing
APP_KEY=base64:9PkNI1ZhB4EZOvuabI4JXeKyXfG7u71JkYKQAqFMu8E=
APP_DEBUG=true
APP_URL=http://developer-test.test

DB_CONNECTION=sqlite
TEST_USER_EMAIL='test@example.com'
TEST_USER_PASSWORD='password'

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

MAIL_FROM_ADDRESS="crewplanner@example.com"
MAIL_FROM_NAME="${APP_NAME}"

VITE_APP_NAME="${APP_NAME}"
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* text=auto eol=lf

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
CHANGELOG.md export-ignore
.styleci.yml export-ignore
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
*.log
.DS_Store
.env
.env.backup
.env.production
.phpactor.json
.phpunit.result.cache
/.codex
/.cursor/
/.idea
/.nova
/.phpunit.cache
/.vscode
/.zed
/auth.json
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/storage/pail
/vendor
_ide_helper.php
Homestead.json
Homestead.yaml
Thumbs.db
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore-scripts=true
audit=true
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>

<p align="center">
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>

## About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).

Laravel is accessible, powerful, and provides tools required for large, robust applications.

## Learning Laravel

Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

In addition, [Laracasts](https://laracasts.com) contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

You can also watch bite-sized lessons with real-world projects on [Laravel Learn](https://laravel.com/learn), where you will be guided through building a Laravel application from scratch while learning PHP fundamentals.

## Agentic Development

Laravel's predictable structure and conventions make it ideal for AI coding agents like Claude Code, Cursor, and GitHub Copilot. Install [Laravel Boost](https://laravel.com/docs/ai) to supercharge your AI workflow:

```bash
composer require laravel/boost --dev

php artisan boost:install
```

Boost provides your agent 15+ tools and skills that help agents build Laravel applications while following best practices.

## Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).

## Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).

## Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.

## License

The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
88 changes: 88 additions & 0 deletions app/Console/Commands/CreateCustomer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php

namespace App\Console\Commands;

use App\Models\Customer;
use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Validator as ValidatorFacade;
use Illuminate\Support\Str;
use Illuminate\Validation\Validator;

use function Laravel\Prompts\password;
use function Laravel\Prompts\text;

#[Signature('customer:create {--name=} {--email=} {--password=}')]
#[Description('Command description')]
class CreateCustomer extends Command
{
private Validator $validator;

/**
* Execute the console command.
*/
public function handle()
{
$this->validator = ValidatorFacade::make($this->options(), ['email' => 'email|unique:customers']);

$name = $this->getFullName();
$email = $this->getEmail();
$password = $this->getPassword();

$customer = new Customer;
$customer->name = $name;
$customer->email = $email;
$customer->password = $password;
$customer->email_verified_at = now();
$customer->remember_token = Str::random(10);

if ($customer->save()) {
$this->info("The customer $customer->name with the email $customer->email has been created");

return Command::SUCCESS;
}

return Command::FAILURE;
}

private function getFullName(): string
{
return $this->option('name')
? $this->option('name')
: text(
label: 'Full name',
placeholder: 'Ex: John Doe',
required: true
);
}

private function getEmail(): string
{
if ($this->validator->errors()->has('email')) {
return text(
label: 'Email',
placeholder: 'Ex: John Doe',
validate: ['email' => 'email|unique:customers'],
required: true
);
}

return $this->option('email');
}

private function getPassword(): string
{
$password = $this->option('password')
? $this->option('password')
: password(
label: 'Password',
placeholder: 'Ex: NOT QWERTY',
hint: 'Leave empty to let the app generate it',
);

return $password
? $password
: Str::random(40);
}
}
27 changes: 27 additions & 0 deletions app/Http/Controllers/Authentification/LoginController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace App\Http\Controllers\Authentification;

use App\Http\Controllers\Controller;
use App\Http\Requests\LoginRequest;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Auth;

class LoginController extends Controller
{
/**
* Handle the incoming request.
*/
public function __invoke(LoginRequest $request): RedirectResponse
{
$credentials = $request->only('email', 'password');

if (Auth::attempt($credentials)) {
return redirect()->route('home');
}

return back()->withErrors([
'login' => 'The provided credentials do not match our records.',
])->onlyInput('email');
}
}
27 changes: 27 additions & 0 deletions app/Http/Controllers/Authentification/LogoutController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace App\Http\Controllers\Authentification;

use App\Http\Controllers\Controller;
use App\Http\Requests\LoginRequest;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class LogoutController extends Controller
{
/**
* Handle the incoming request.
*/
public function __invoke(Request $request): RedirectResponse
{
Auth::logout();

$request->session()->invalidate();
$request->session()->regenerateToken();

return redirect()
->route('home')
->with('success', 'You have been logged out.');
}
}
8 changes: 8 additions & 0 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace App\Http\Controllers;

abstract class Controller
{
//
}
16 changes: 16 additions & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class HomeController extends Controller
{
/**
* Handle the incoming request.
*/
public function __invoke(Request $request)
{
return view('pages.home');
}
}
Loading