-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
FideleLesobre2022
committed
Dec 24, 2023
0 parents
commit 281ad23
Showing
820 changed files
with
104,065 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
[docker-compose.yml] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
|
||
LOG_CHANNEL=stack | ||
LOG_DEPRECATIONS_CHANNEL=null | ||
LOG_LEVEL=debug | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=laravel | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
FILESYSTEM_DISK=local | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
|
||
MEMCACHED_HOST=127.0.0.1 | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=mailpit | ||
MAIL_PORT=1025 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS="[email protected]" | ||
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 | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_HOST= | ||
PUSHER_PORT=443 | ||
PUSHER_SCHEME=https | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
VITE_APP_NAME="${APP_NAME}" | ||
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
VITE_PUSHER_HOST="${PUSHER_HOST}" | ||
VITE_PUSHER_PORT="${PUSHER_PORT}" | ||
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" | ||
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/.phpunit.cache | ||
/node_modules | ||
/public/build | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
.env | ||
.env.backup | ||
.env.production | ||
.phpunit.result.cache | ||
Homestead.json | ||
Homestead.yaml | ||
auth.json | ||
npm-debug.log | ||
yarn-error.log | ||
/.fleet | ||
/.idea | ||
/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<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. | ||
|
||
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. | ||
|
||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 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. | ||
|
||
## Laravel Sponsors | ||
|
||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com). | ||
|
||
### Premium Partners | ||
|
||
- **[Vehikl](https://vehikl.com/)** | ||
- **[Tighten Co.](https://tighten.co)** | ||
- **[WebReinvent](https://webreinvent.com/)** | ||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** | ||
- **[64 Robots](https://64robots.com)** | ||
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)** | ||
- **[Cyber-Duck](https://cyber-duck.co.uk)** | ||
- **[DevSquad](https://devsquad.com/hire-laravel-developers)** | ||
- **[Jump24](https://jump24.co.uk)** | ||
- **[Redberry](https://redberry.international/laravel/)** | ||
- **[Active Logic](https://activelogic.com)** | ||
- **[byte5](https://byte5.de)** | ||
- **[OP.GG](https://op.gg)** | ||
|
||
## 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 [[email protected]](mailto:[email protected]). 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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* Define the application's command schedule. | ||
*/ | ||
protected function schedule(Schedule $schedule): void | ||
{ | ||
// $schedule->command('inspire')->hourly(); | ||
} | ||
|
||
/** | ||
* Register the commands for the application. | ||
*/ | ||
protected function commands(): void | ||
{ | ||
$this->load(__DIR__.'/Commands'); | ||
|
||
require base_path('routes/console.php'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
use Throwable; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* The list of the inputs that are never flashed to the session on validation exceptions. | ||
* | ||
* @var array<int, string> | ||
*/ | ||
protected $dontFlash = [ | ||
'current_password', | ||
'password', | ||
'password_confirmation', | ||
]; | ||
|
||
/** | ||
* Register the exception handling callbacks for the application. | ||
*/ | ||
public function register(): void | ||
{ | ||
$this->reportable(function (Throwable $e) { | ||
// | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Models\Client; | ||
use Illuminate\Http\Request; | ||
|
||
class ClientController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
public function index() | ||
{ | ||
//Corriger la numérotation | ||
$counter = 1; | ||
//Charger les données de la DB | ||
$clients = Client::all(); | ||
return view('clients.index', compact('clients', 'counter')); | ||
|
||
|
||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
*/ | ||
public function create() | ||
{ | ||
//Appel du formulaire d'ajout du client | ||
return view('clients.create'); | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
// Validation des champs de formulaire | ||
// Sachant que validate est inclu dans la classe Request | ||
$request->validate | ||
([ | ||
'prenom_client' => 'required', | ||
'nom_client' => 'required', | ||
'phone_client' => 'unique:clients,phone_client|max:13', | ||
'email_client' => 'unique:clients,email_client|max:50|email', | ||
'adresse_client' => 'required', | ||
]); | ||
|
||
// 1: Ajout du client à la base de données | ||
// 1. 1: Appel de la classe Client étant égal à la classe définie dans Models.Client | ||
// On stocke le new Client dans une variable pour pas qu'on l'invoque à chaque élement de la Classe | ||
$client = new Client; | ||
|
||
// 1. 2: Compléter les élements contenus dans $request comme décrit sur la fonction store() | ||
// 1. 3: Comme Client est une classe, indexer chaque variable; préciser la valeur | ||
// Mais en décomposant aussi la variable $request qui est une classe de Request() | ||
$client->nom_client = $request->nom_client; | ||
$client->prenom_client = $request->prenom_client; | ||
$client->phone_client = $request->phone_client; | ||
$client->email_client = $request->email_client; | ||
$client->adresse_client = $request->adresse_client; | ||
// 1. 4: On précise l'action à faire, enregistrer le nouveau client $client = new Client | ||
$client->save(); | ||
|
||
// 1. 5: Après l'enregistrement au aura besoin d'être rediriger sur une page pour pas avoir une page blanche | ||
// !! Ici on nous rediriger vers l'url localhost:post_choisi/clients | ||
return redirect(route('clients.index')); | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
*/ | ||
public function show(string $id) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
*/ | ||
public function edit(string $id) | ||
{ | ||
//Avant de récupérer le formulaire, récupérer d'abord des informations du client à l'$id choisi | ||
$client = Client::findOrfail($id); | ||
|
||
//Appeler le formulaire en tenant compte de l'id séléctionner | ||
return view('clients.edit', compact('client')); | ||
|
||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
*/ | ||
public function update(Request $request, string $id) | ||
{ | ||
// Validation pour éviter tout compromis | ||
$request->validate | ||
([ | ||
'prenom_client' => 'required', | ||
'nom_client' => 'required', | ||
'phone_client' => 'unique:clients,phone_client|max:13', | ||
'email_client' => 'unique:clients,email_client|max:50|email', | ||
'adresse_client' => 'required', | ||
]); | ||
$client = Client::findOrfail($id); | ||
$client->nom_client = $request->get('nom_client'); | ||
$client->prenom_client = $request->get('prenom_client'); | ||
$client->phone_client = $request->get('phone_client'); | ||
$client->email_client = $request->get('email_client'); | ||
$client->adresse_client = $request->get('adresse_client'); | ||
|
||
$client->save(); | ||
|
||
// 1. 5: Après l'enregistrement au aura besoin d'être rediriger sur une page pour pas avoir une page blanche | ||
// !! Ici on nous rediriger vers l'url localhost:post_choisi/clients | ||
return redirect(route('clients.index')); | ||
|
||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
*/ | ||
public function destroy(string $id) | ||
{ | ||
// Pour supprimer un élément on doit | ||
// 1: Localiser l'ID qu'on veut supprimer | ||
$client = Client::find($id); | ||
// 2: On le supprime | ||
$client->delete(); | ||
return redirect()->route('clients.index')->with('Success', 'Client a été supprimer avec succes'); | ||
// Attention: | ||
// - Ici la variable $client est toujours égal à new Client | ||
// - Un id supprimer ne peut plus être récuperer | ||
// - Si tu supprime l'$id 1 donc, il y aura plus jamais d'$id 1 | ||
// Voire concept de $id autoincrement | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; | ||
use Illuminate\Foundation\Validation\ValidatesRequests; | ||
use Illuminate\Routing\Controller as BaseController; | ||
|
||
class Controller extends BaseController | ||
{ | ||
use AuthorizesRequests, ValidatesRequests; | ||
} |
Oops, something went wrong.