Compare commits
2 Commits
test_formu
...
sampleblog
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5a03737a9 | ||
|
|
2c4aeb4704 |
0
laravel/.buildcomplete
Normal file → Executable file
0
laravel/.buildcomplete
Normal file → Executable file
0
laravel/.editorconfig
Normal file → Executable file
0
laravel/.editorconfig
Normal file → Executable file
0
laravel/.env.example
Normal file → Executable file
0
laravel/.env.example
Normal file → Executable file
0
laravel/.gitattributes
vendored
Normal file → Executable file
0
laravel/.gitattributes
vendored
Normal file → Executable file
0
laravel/.gitignore
vendored
Normal file → Executable file
0
laravel/.gitignore
vendored
Normal file → Executable file
0
laravel/.spdx-laravel.spdx
Normal file → Executable file
0
laravel/.spdx-laravel.spdx
Normal file → Executable file
0
laravel/README.md
Normal file → Executable file
0
laravel/README.md
Normal file → Executable file
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Requests\StoreBilletRequest;
|
|
||||||
use App\Http\Requests\UpdateBilletRequest;
|
|
||||||
use App\Models\Billet;
|
use App\Models\Billet;
|
||||||
|
use App\Http\Resources\BilletResource;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class BilletController extends Controller
|
class BilletController extends Controller
|
||||||
{
|
{
|
||||||
@@ -13,22 +14,22 @@ class BilletController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$billets = Billet::all();
|
//Return all posts in json format
|
||||||
return view('index', compact('billets'));
|
try {
|
||||||
}
|
return BilletResource::collection(Billet::with('commentaires')->get());
|
||||||
|
}
|
||||||
/**
|
catch (\Illuminate\Database\QueryException $e){
|
||||||
* Show the form for creating a new resource.
|
Log::channel('projectError')->error('Erreur accès base de données');
|
||||||
*/
|
return response()->json([
|
||||||
public function create()
|
'message' => 'Ressource indinponible.'
|
||||||
{
|
],500);
|
||||||
//
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*/
|
*/
|
||||||
public function store(StoreBilletRequest $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
@@ -38,21 +39,21 @@ class BilletController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function show(Billet $billet)
|
public function show(Billet $billet)
|
||||||
{
|
{
|
||||||
//
|
try{
|
||||||
}
|
return new BilletResource($billet);
|
||||||
|
}
|
||||||
/**
|
catch (\Illuminate\Database\QueryException $e){
|
||||||
* Show the form for editing the specified resource.
|
Log::channel('projectError')->error('Erreur accès base de données');
|
||||||
*/
|
return response()->json([
|
||||||
public function edit(Billet $billet)
|
'message' => 'Ressource indinponible.'
|
||||||
{
|
],500);
|
||||||
//
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*/
|
*/
|
||||||
public function update(UpdateBilletRequest $request, Billet $billet)
|
public function update(Request $request, Billet $billet)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|||||||
61
laravel/app/Http/Controllers/CommentaireController.php
Normal file
61
laravel/app/Http/Controllers/CommentaireController.php
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Requests\CommentaireRequest;
|
||||||
|
use App\Models\Commentaire;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class CommentaireController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(CommentaireRequest $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
try {
|
||||||
|
$commentaire = Commentaire::create($request->all());
|
||||||
|
return response()->json($commentaire,201);
|
||||||
|
}
|
||||||
|
catch(\Illuminate\Database\QueryException $e){
|
||||||
|
Log::channel('projectError')->error('Erreur accès base de données\n'.$e->getMessage());
|
||||||
|
return response()->json([
|
||||||
|
'message' => 'Ressource indisponible.'
|
||||||
|
],500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(Commentaire $commentaire)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, Commentaire $commentaire)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(Commentaire $commentaire)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
0
laravel/app/Http/Controllers/Controller.php
Normal file → Executable file
0
laravel/app/Http/Controllers/Controller.php
Normal file → Executable file
40
laravel/app/Http/Requests/CommentaireRequest.php
Normal file
40
laravel/app/Http/Requests/CommentaireRequest.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||||
|
use Illuminate\Contracts\Validation\Validator;
|
||||||
|
|
||||||
|
class CommentaireRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*/
|
||||||
|
public function authorize(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'COM_DATE' => ['required', 'date'],
|
||||||
|
'COM_AUTEUR' => ['required', 'string', 'max:100'],
|
||||||
|
'COM_CONTENU' => ['required', 'string', 'max:200'],
|
||||||
|
'billet_id' => ['required', 'integer'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function failedValidation(Validator $validator){
|
||||||
|
throw new HttpResponseException(response()->json([
|
||||||
|
'success' => false,
|
||||||
|
'message' => 'Validation errors',
|
||||||
|
'data' => $validator->errors()
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
}
|
||||||
0
laravel/app/Http/Requests/StoreBilletRequest.php
Normal file → Executable file
0
laravel/app/Http/Requests/StoreBilletRequest.php
Normal file → Executable file
0
laravel/app/Http/Requests/UpdateBilletRequest.php
Normal file → Executable file
0
laravel/app/Http/Requests/UpdateBilletRequest.php
Normal file → Executable file
25
laravel/app/Http/Resources/BilletResource.php
Normal file
25
laravel/app/Http/Resources/BilletResource.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Resources;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
|
class BilletResource extends JsonResource
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Transform the resource into an array.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function toArray(Request $request): array
|
||||||
|
{
|
||||||
|
//return parent::toArray($request);
|
||||||
|
return [
|
||||||
|
'Date' => $this->BIL_DATE,
|
||||||
|
'Titre' => $this->BIL_TITRE,
|
||||||
|
'Contenu' => $this->BIL_CONTENU,
|
||||||
|
'Commentaires' => CommentaireResource::collection($this->commentaires),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
24
laravel/app/Http/Resources/CommentaireResource.php
Normal file
24
laravel/app/Http/Resources/CommentaireResource.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Resources;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
|
class CommentaireResource extends JsonResource
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Transform the resource into an array.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function toArray(Request $request): array
|
||||||
|
{
|
||||||
|
//return parent::toArray($request);
|
||||||
|
return [
|
||||||
|
'Date' => $this->COM_DATE,
|
||||||
|
'Auteur' => $this->COM_AUTEUR,
|
||||||
|
'Contenu' => $this->COM_CONTENU,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,59 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Billet
|
||||||
|
*
|
||||||
|
* @property int $id
|
||||||
|
* @property Carbon $BIL_DATE
|
||||||
|
* @property string $BIL_TITRE
|
||||||
|
* @property string $BIL_CONTENU
|
||||||
|
* @property Carbon|null $created_at
|
||||||
|
* @property Carbon|null $updated_at
|
||||||
|
*
|
||||||
|
* @property Collection|BilletCategorie[] $billet_categories
|
||||||
|
* @property Collection|Commentaire[] $commentaires
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
class Billet extends Model
|
class Billet extends Model
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\BilletFactory> */
|
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
protected $table = 'billets';
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'BIL_DATE' => 'datetime'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'BIL_DATE',
|
||||||
|
'BIL_TITRE',
|
||||||
|
'BIL_CONTENU'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $hidden = [
|
||||||
|
'id',
|
||||||
|
'created_at',
|
||||||
|
'updated_at'
|
||||||
|
];
|
||||||
|
|
||||||
|
public function billet_categories()
|
||||||
|
{
|
||||||
|
return $this->hasMany(BilletCategorie::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function commentaires()
|
||||||
|
{
|
||||||
|
return $this->hasMany(Commentaire::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
49
laravel/app/Models/BilletCategorie.php
Normal file
49
laravel/app/Models/BilletCategorie.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class BilletCategorie
|
||||||
|
*
|
||||||
|
* @property int $id
|
||||||
|
* @property int $billet_id
|
||||||
|
* @property int $categorie_id
|
||||||
|
* @property Carbon|null $created_at
|
||||||
|
* @property Carbon|null $updated_at
|
||||||
|
*
|
||||||
|
* @property Billet $billet
|
||||||
|
* @property Category $category
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
|
class BilletCategorie extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'billet_categorie';
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'billet_id' => 'int',
|
||||||
|
'categorie_id' => 'int'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'billet_id',
|
||||||
|
'categorie_id'
|
||||||
|
];
|
||||||
|
|
||||||
|
public function billet()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Billet::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function category()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Category::class, 'categorie_id');
|
||||||
|
}
|
||||||
|
}
|
||||||
35
laravel/app/Models/Cache.php
Executable file
35
laravel/app/Models/Cache.php
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Cache
|
||||||
|
*
|
||||||
|
* @property string $key
|
||||||
|
* @property string $value
|
||||||
|
* @property int $expiration
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
|
class Cache extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'cache';
|
||||||
|
protected $primaryKey = 'key';
|
||||||
|
public $incrementing = false;
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'expiration' => 'int'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'value',
|
||||||
|
'expiration'
|
||||||
|
];
|
||||||
|
}
|
||||||
35
laravel/app/Models/CacheLock.php
Executable file
35
laravel/app/Models/CacheLock.php
Executable file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class CacheLock
|
||||||
|
*
|
||||||
|
* @property string $key
|
||||||
|
* @property string $owner
|
||||||
|
* @property int $expiration
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
|
class CacheLock extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'cache_locks';
|
||||||
|
protected $primaryKey = 'key';
|
||||||
|
public $incrementing = false;
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'expiration' => 'int'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'owner',
|
||||||
|
'expiration'
|
||||||
|
];
|
||||||
|
}
|
||||||
37
laravel/app/Models/Category.php
Normal file
37
laravel/app/Models/Category.php
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Category
|
||||||
|
*
|
||||||
|
* @property int $id
|
||||||
|
* @property string $CAT_NOM
|
||||||
|
* @property Carbon|null $created_at
|
||||||
|
* @property Carbon|null $updated_at
|
||||||
|
*
|
||||||
|
* @property Collection|BilletCategorie[] $billet_categories
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
|
class Category extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'categories';
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'CAT_NOM'
|
||||||
|
];
|
||||||
|
|
||||||
|
public function billet_categories()
|
||||||
|
{
|
||||||
|
return $this->hasMany(BilletCategorie::class, 'categorie_id');
|
||||||
|
}
|
||||||
|
}
|
||||||
54
laravel/app/Models/Commentaire.php
Normal file
54
laravel/app/Models/Commentaire.php
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Commentaire
|
||||||
|
*
|
||||||
|
* @property int $id
|
||||||
|
* @property Carbon $COM_DATE
|
||||||
|
* @property string $COM_AUTEUR
|
||||||
|
* @property string $COM_CONTENU
|
||||||
|
* @property int $billet_id
|
||||||
|
* @property Carbon|null $created_at
|
||||||
|
* @property Carbon|null $updated_at
|
||||||
|
*
|
||||||
|
* @property Billet $billet
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
|
class Commentaire extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'commentaires';
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'COM_DATE' => 'datetime',
|
||||||
|
'billet_id' => 'int'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'COM_DATE',
|
||||||
|
'COM_AUTEUR',
|
||||||
|
'COM_CONTENU',
|
||||||
|
'billet_id'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $hidden = [
|
||||||
|
'id',
|
||||||
|
'created_at',
|
||||||
|
'updated_at',
|
||||||
|
'billet_id'
|
||||||
|
];
|
||||||
|
|
||||||
|
public function billet()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Billet::class);
|
||||||
|
}
|
||||||
|
}
|
||||||
42
laravel/app/Models/Job.php
Executable file
42
laravel/app/Models/Job.php
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Job
|
||||||
|
*
|
||||||
|
* @property int $id
|
||||||
|
* @property string $queue
|
||||||
|
* @property string $payload
|
||||||
|
* @property int $attempts
|
||||||
|
* @property int|null $reserved_at
|
||||||
|
* @property int $available_at
|
||||||
|
* @property int $created_at
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
|
class Job extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'jobs';
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'attempts' => 'int',
|
||||||
|
'reserved_at' => 'int',
|
||||||
|
'available_at' => 'int'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'queue',
|
||||||
|
'payload',
|
||||||
|
'attempts',
|
||||||
|
'reserved_at',
|
||||||
|
'available_at'
|
||||||
|
];
|
||||||
|
}
|
||||||
51
laravel/app/Models/JobBatch.php
Executable file
51
laravel/app/Models/JobBatch.php
Executable file
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class JobBatch
|
||||||
|
*
|
||||||
|
* @property string $id
|
||||||
|
* @property string $name
|
||||||
|
* @property int $total_jobs
|
||||||
|
* @property int $pending_jobs
|
||||||
|
* @property int $failed_jobs
|
||||||
|
* @property string $failed_job_ids
|
||||||
|
* @property string|null $options
|
||||||
|
* @property int|null $cancelled_at
|
||||||
|
* @property int $created_at
|
||||||
|
* @property int|null $finished_at
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
|
class JobBatch extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'job_batches';
|
||||||
|
public $incrementing = false;
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'total_jobs' => 'int',
|
||||||
|
'pending_jobs' => 'int',
|
||||||
|
'failed_jobs' => 'int',
|
||||||
|
'cancelled_at' => 'int',
|
||||||
|
'finished_at' => 'int'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'total_jobs',
|
||||||
|
'pending_jobs',
|
||||||
|
'failed_jobs',
|
||||||
|
'failed_job_ids',
|
||||||
|
'options',
|
||||||
|
'cancelled_at',
|
||||||
|
'finished_at'
|
||||||
|
];
|
||||||
|
}
|
||||||
41
laravel/app/Models/Session.php
Executable file
41
laravel/app/Models/Session.php
Executable file
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Session
|
||||||
|
*
|
||||||
|
* @property string $id
|
||||||
|
* @property int|null $user_id
|
||||||
|
* @property string|null $ip_address
|
||||||
|
* @property string|null $user_agent
|
||||||
|
* @property string $payload
|
||||||
|
* @property int $last_activity
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
|
class Session extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'sessions';
|
||||||
|
public $incrementing = false;
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'user_id' => 'int',
|
||||||
|
'last_activity' => 'int'
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'user_id',
|
||||||
|
'ip_address',
|
||||||
|
'user_agent',
|
||||||
|
'payload',
|
||||||
|
'last_activity'
|
||||||
|
];
|
||||||
|
}
|
||||||
75
laravel/app/Models/User.php
Normal file → Executable file
75
laravel/app/Models/User.php
Normal file → Executable file
@@ -1,48 +1,49 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Reliese Model.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Notifications\Notifiable;
|
|
||||||
|
|
||||||
class User extends Authenticatable
|
/**
|
||||||
|
* Class User
|
||||||
|
*
|
||||||
|
* @property int $id
|
||||||
|
* @property string $name
|
||||||
|
* @property string $email
|
||||||
|
* @property Carbon|null $email_verified_at
|
||||||
|
* @property string $password
|
||||||
|
* @property string|null $remember_token
|
||||||
|
* @property Carbon|null $created_at
|
||||||
|
* @property Carbon|null $updated_at
|
||||||
|
*
|
||||||
|
* @package App\Models
|
||||||
|
*/
|
||||||
|
class User extends Model
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
use HasFactory;
|
||||||
use HasFactory, Notifiable;
|
|
||||||
|
|
||||||
/**
|
protected $table = 'users';
|
||||||
* The attributes that are mass assignable.
|
|
||||||
*
|
|
||||||
* @var list<string>
|
|
||||||
*/
|
|
||||||
protected $fillable = [
|
|
||||||
'name',
|
|
||||||
'email',
|
|
||||||
'password',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
protected $casts = [
|
||||||
* The attributes that should be hidden for serialization.
|
'email_verified_at' => 'datetime'
|
||||||
*
|
];
|
||||||
* @var list<string>
|
|
||||||
*/
|
|
||||||
protected $hidden = [
|
|
||||||
'password',
|
|
||||||
'remember_token',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
protected $hidden = [
|
||||||
* Get the attributes that should be cast.
|
'password',
|
||||||
*
|
'remember_token'
|
||||||
* @return array<string, string>
|
];
|
||||||
*/
|
|
||||||
protected function casts(): array
|
protected $fillable = [
|
||||||
{
|
'name',
|
||||||
return [
|
'email',
|
||||||
'email_verified_at' => 'datetime',
|
'email_verified_at',
|
||||||
'password' => 'hashed',
|
'password',
|
||||||
];
|
'remember_token'
|
||||||
}
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
0
laravel/app/Policies/BilletPolicy.php
Normal file → Executable file
0
laravel/app/Policies/BilletPolicy.php
Normal file → Executable file
0
laravel/app/Providers/AppServiceProvider.php
Normal file → Executable file
0
laravel/app/Providers/AppServiceProvider.php
Normal file → Executable file
8
laravel/bootstrap/app.php
Normal file → Executable file
8
laravel/bootstrap/app.php
Normal file → Executable file
@@ -3,10 +3,12 @@
|
|||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Foundation\Configuration\Exceptions;
|
use Illuminate\Foundation\Configuration\Exceptions;
|
||||||
use Illuminate\Foundation\Configuration\Middleware;
|
use Illuminate\Foundation\Configuration\Middleware;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
return Application::configure(basePath: dirname(__DIR__))
|
return Application::configure(basePath: dirname(__DIR__))
|
||||||
->withRouting(
|
->withRouting(
|
||||||
web: __DIR__.'/../routes/web.php',
|
web: __DIR__.'/../routes/web.php',
|
||||||
|
api: __DIR__.'/../routes/api.php',
|
||||||
commands: __DIR__.'/../routes/console.php',
|
commands: __DIR__.'/../routes/console.php',
|
||||||
health: '/up',
|
health: '/up',
|
||||||
)
|
)
|
||||||
@@ -14,5 +16,9 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||||||
//
|
//
|
||||||
})
|
})
|
||||||
->withExceptions(function (Exceptions $exceptions) {
|
->withExceptions(function (Exceptions $exceptions) {
|
||||||
//
|
$exceptions->renderable(function (NotFoundHttpException $e){
|
||||||
|
return response()->json([
|
||||||
|
'message' => 'Ressource non trouvée.'
|
||||||
|
],404);
|
||||||
|
});
|
||||||
})->create();
|
})->create();
|
||||||
|
|||||||
0
laravel/bootstrap/cache/.gitignore
vendored
Normal file → Executable file
0
laravel/bootstrap/cache/.gitignore
vendored
Normal file → Executable file
0
laravel/bootstrap/providers.php
Normal file → Executable file
0
laravel/bootstrap/providers.php
Normal file → Executable file
4
laravel/composer.json
Normal file → Executable file
4
laravel/composer.json
Normal file → Executable file
@@ -8,6 +8,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^8.2",
|
"php": "^8.2",
|
||||||
"laravel/framework": "^12.0",
|
"laravel/framework": "^12.0",
|
||||||
|
"laravel/sanctum": "^4.0",
|
||||||
"laravel/tinker": "^2.10.1"
|
"laravel/tinker": "^2.10.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
@@ -17,7 +18,8 @@
|
|||||||
"laravel/sail": "^1.41",
|
"laravel/sail": "^1.41",
|
||||||
"mockery/mockery": "^1.6",
|
"mockery/mockery": "^1.6",
|
||||||
"nunomaduro/collision": "^8.6",
|
"nunomaduro/collision": "^8.6",
|
||||||
"phpunit/phpunit": "^11.5.3"
|
"phpunit/phpunit": "^11.5.3",
|
||||||
|
"reliese/laravel": "^1.4"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
332
laravel/composer.lock
generated
Normal file → Executable file
332
laravel/composer.lock
generated
Normal file → Executable file
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "88970a0117c062eed55fa8728fc43833",
|
"content-hash": "cc1f42d2dd2bf6629798006e6a8a4606",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "brick/math",
|
"name": "brick/math",
|
||||||
@@ -1328,6 +1328,70 @@
|
|||||||
},
|
},
|
||||||
"time": "2025-02-11T13:34:40+00:00"
|
"time": "2025-02-11T13:34:40+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "laravel/sanctum",
|
||||||
|
"version": "v4.1.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/laravel/sanctum.git",
|
||||||
|
"reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/laravel/sanctum/zipball/a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
|
||||||
|
"reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"illuminate/console": "^11.0|^12.0",
|
||||||
|
"illuminate/contracts": "^11.0|^12.0",
|
||||||
|
"illuminate/database": "^11.0|^12.0",
|
||||||
|
"illuminate/support": "^11.0|^12.0",
|
||||||
|
"php": "^8.2",
|
||||||
|
"symfony/console": "^7.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"mockery/mockery": "^1.6",
|
||||||
|
"orchestra/testbench": "^9.0|^10.0",
|
||||||
|
"phpstan/phpstan": "^1.10",
|
||||||
|
"phpunit/phpunit": "^11.3"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"Laravel\\Sanctum\\SanctumServiceProvider"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Laravel\\Sanctum\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.",
|
||||||
|
"keywords": [
|
||||||
|
"auth",
|
||||||
|
"laravel",
|
||||||
|
"sanctum"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/sanctum/issues",
|
||||||
|
"source": "https://github.com/laravel/sanctum"
|
||||||
|
},
|
||||||
|
"time": "2025-04-23T13:03:38+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/serializable-closure",
|
"name": "laravel/serializable-closure",
|
||||||
"version": "v2.0.4",
|
"version": "v2.0.4",
|
||||||
@@ -5787,6 +5851,160 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
|
{
|
||||||
|
"name": "doctrine/dbal",
|
||||||
|
"version": "4.2.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/doctrine/dbal.git",
|
||||||
|
"reference": "33d2d7fe1269b2301640c44cf2896ea607b30e3e"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/doctrine/dbal/zipball/33d2d7fe1269b2301640c44cf2896ea607b30e3e",
|
||||||
|
"reference": "33d2d7fe1269b2301640c44cf2896ea607b30e3e",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"doctrine/deprecations": "^0.5.3|^1",
|
||||||
|
"php": "^8.1",
|
||||||
|
"psr/cache": "^1|^2|^3",
|
||||||
|
"psr/log": "^1|^2|^3"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"doctrine/coding-standard": "12.0.0",
|
||||||
|
"fig/log-test": "^1",
|
||||||
|
"jetbrains/phpstorm-stubs": "2023.2",
|
||||||
|
"phpstan/phpstan": "2.1.1",
|
||||||
|
"phpstan/phpstan-phpunit": "2.0.3",
|
||||||
|
"phpstan/phpstan-strict-rules": "^2",
|
||||||
|
"phpunit/phpunit": "10.5.39",
|
||||||
|
"slevomat/coding-standard": "8.13.1",
|
||||||
|
"squizlabs/php_codesniffer": "3.10.2",
|
||||||
|
"symfony/cache": "^6.3.8|^7.0",
|
||||||
|
"symfony/console": "^5.4|^6.3|^7.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"symfony/console": "For helpful console commands such as SQL execution and import of files."
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Doctrine\\DBAL\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Guilherme Blanco",
|
||||||
|
"email": "guilhermeblanco@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Roman Borschel",
|
||||||
|
"email": "roman@code-factory.org"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Benjamin Eberlei",
|
||||||
|
"email": "kontakt@beberlei.de"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jonathan Wage",
|
||||||
|
"email": "jonwage@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.",
|
||||||
|
"homepage": "https://www.doctrine-project.org/projects/dbal.html",
|
||||||
|
"keywords": [
|
||||||
|
"abstraction",
|
||||||
|
"database",
|
||||||
|
"db2",
|
||||||
|
"dbal",
|
||||||
|
"mariadb",
|
||||||
|
"mssql",
|
||||||
|
"mysql",
|
||||||
|
"oci8",
|
||||||
|
"oracle",
|
||||||
|
"pdo",
|
||||||
|
"pgsql",
|
||||||
|
"postgresql",
|
||||||
|
"queryobject",
|
||||||
|
"sasql",
|
||||||
|
"sql",
|
||||||
|
"sqlite",
|
||||||
|
"sqlserver",
|
||||||
|
"sqlsrv"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/doctrine/dbal/issues",
|
||||||
|
"source": "https://github.com/doctrine/dbal/tree/4.2.3"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://www.doctrine-project.org/sponsorship.html",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://www.patreon.com/phpdoctrine",
|
||||||
|
"type": "patreon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2025-03-07T18:29:05+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "doctrine/deprecations",
|
||||||
|
"version": "1.1.5",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/doctrine/deprecations.git",
|
||||||
|
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
|
||||||
|
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.1 || ^8.0"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"phpunit/phpunit": "<=7.5 || >=13"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"doctrine/coding-standard": "^9 || ^12 || ^13",
|
||||||
|
"phpstan/phpstan": "1.4.10 || 2.1.11",
|
||||||
|
"phpstan/phpstan-phpunit": "^1.0 || ^2",
|
||||||
|
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
|
||||||
|
"psr/log": "^1 || ^2 || ^3"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Doctrine\\Deprecations\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
|
||||||
|
"homepage": "https://www.doctrine-project.org/",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/doctrine/deprecations/issues",
|
||||||
|
"source": "https://github.com/doctrine/deprecations/tree/1.1.5"
|
||||||
|
},
|
||||||
|
"time": "2025-04-07T20:06:18+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "fakerphp/faker",
|
"name": "fakerphp/faker",
|
||||||
"version": "v1.24.1",
|
"version": "v1.24.1",
|
||||||
@@ -6963,6 +7181,118 @@
|
|||||||
],
|
],
|
||||||
"time": "2025-04-08T07:59:11+00:00"
|
"time": "2025-04-08T07:59:11+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "psr/cache",
|
||||||
|
"version": "3.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-fig/cache.git",
|
||||||
|
"reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
|
||||||
|
"reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=8.0.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.0.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Psr\\Cache\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "PHP-FIG",
|
||||||
|
"homepage": "https://www.php-fig.org/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Common interface for caching libraries",
|
||||||
|
"keywords": [
|
||||||
|
"cache",
|
||||||
|
"psr",
|
||||||
|
"psr-6"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/php-fig/cache/tree/3.0.0"
|
||||||
|
},
|
||||||
|
"time": "2021-02-03T23:26:27+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "reliese/laravel",
|
||||||
|
"version": "v1.4.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/reliese/laravel.git",
|
||||||
|
"reference": "2181113d420cae67ec68b6bbe6f325900856d6b9"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/reliese/laravel/zipball/2181113d420cae67ec68b6bbe6f325900856d6b9",
|
||||||
|
"reference": "2181113d420cae67ec68b6bbe6f325900856d6b9",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"doctrine/dbal": ">=2.5",
|
||||||
|
"illuminate/console": ">=5.1",
|
||||||
|
"illuminate/contracts": ">=5.1",
|
||||||
|
"illuminate/database": ">=5.1",
|
||||||
|
"illuminate/filesystem": ">=5.1",
|
||||||
|
"illuminate/support": ">=5.1",
|
||||||
|
"php": "^7.3|^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"fzaninotto/faker": "~1.4",
|
||||||
|
"mockery/mockery": ">=1.4",
|
||||||
|
"phpunit/phpunit": "^9"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"Reliese\\Coders\\CodersServiceProvider"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Reliese\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Cristian Llanos",
|
||||||
|
"email": "cristianllanos@outlook.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Reliese Components for Laravel Framework code generation.",
|
||||||
|
"homepage": "http://cristianllanos.com",
|
||||||
|
"keywords": [
|
||||||
|
"laravel",
|
||||||
|
"reliese"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/reliese/laravel/issues",
|
||||||
|
"source": "https://github.com/reliese/laravel"
|
||||||
|
},
|
||||||
|
"time": "2025-03-20T16:16:48+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/cli-parser",
|
"name": "sebastian/cli-parser",
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
|
|||||||
0
laravel/config/app.php
Normal file → Executable file
0
laravel/config/app.php
Normal file → Executable file
0
laravel/config/auth.php
Normal file → Executable file
0
laravel/config/auth.php
Normal file → Executable file
0
laravel/config/cache.php
Normal file → Executable file
0
laravel/config/cache.php
Normal file → Executable file
0
laravel/config/database.php
Normal file → Executable file
0
laravel/config/database.php
Normal file → Executable file
0
laravel/config/filesystems.php
Normal file → Executable file
0
laravel/config/filesystems.php
Normal file → Executable file
0
laravel/config/logging.php
Normal file → Executable file
0
laravel/config/logging.php
Normal file → Executable file
0
laravel/config/mail.php
Normal file → Executable file
0
laravel/config/mail.php
Normal file → Executable file
534
laravel/config/models.php
Executable file
534
laravel/config/models.php
Executable file
@@ -0,0 +1,534 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Configurations
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| In this section you may define the default configuration for each model
|
||||||
|
| that will be generated from any database.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'*' => [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Model Files Location
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| We need a location to store your new generated files. All files will be
|
||||||
|
| placed within this directory. When you turn on base files, they will
|
||||||
|
| be placed within a Base directory inside this location.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'path' => app_path('Models'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Model Namespace
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Every generated model will belong to this namespace. It is suggested
|
||||||
|
| that this namespace should follow PSR-4 convention and be very
|
||||||
|
| similar to the path of your models defined above.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'namespace' => 'App\Models',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Parent Class
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| All Eloquent models should inherit from Eloquent Model class. However,
|
||||||
|
| you can define a custom Eloquent model that suits your needs.
|
||||||
|
| As an example one custom model has been added for you which
|
||||||
|
| will allow you to create custom database castings.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'parent' => Illuminate\Database\Eloquent\Model::class,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Traits
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Sometimes you may want to append certain traits to all your models.
|
||||||
|
| If that is what you need, you may list them bellow.
|
||||||
|
| As an example we have a BitBooleans trait which will treat MySQL bit
|
||||||
|
| data type as booleans. You might probably not need it, but it is
|
||||||
|
| an example of how you can customize your models.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use' => [
|
||||||
|
// Reliese\Database\Eloquent\BitBooleans::class,
|
||||||
|
// Reliese\Database\Eloquent\BlamableBehavior::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Model Connection
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| If you wish your models had appended the connection from which they
|
||||||
|
| were generated, you should set this value to true and your
|
||||||
|
| models will have the connection property filled.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'connection' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Timestamps
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| If your tables have CREATED_AT and UPDATED_AT timestamps you may
|
||||||
|
| enable them and your models will fill their values as needed.
|
||||||
|
| You can also specify which fields should be treated as timestamps
|
||||||
|
| in case you don't follow the naming convention Eloquent uses.
|
||||||
|
| If your table doesn't have these fields, timestamps will be
|
||||||
|
| disabled for your model.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'timestamps' => true,
|
||||||
|
|
||||||
|
// 'timestamps' => [
|
||||||
|
// 'enabled' => true,
|
||||||
|
// 'fields' => [
|
||||||
|
// 'CREATED_AT' => 'created_at',
|
||||||
|
// 'UPDATED_AT' => 'updated_at',
|
||||||
|
// ]
|
||||||
|
// ],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Soft Deletes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| If your tables support soft deletes with a DELETED_AT attribute,
|
||||||
|
| you can enable them here. You can also specify which field
|
||||||
|
| should be treated as a soft delete attribute in case you
|
||||||
|
| don't follow the naming convention Eloquent uses.
|
||||||
|
| If your table doesn't have this field, soft deletes will be
|
||||||
|
| disabled for your model.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'soft_deletes' => true,
|
||||||
|
|
||||||
|
// 'soft_deletes' => [
|
||||||
|
// 'enabled' => true,
|
||||||
|
// 'field' => 'deleted_at',
|
||||||
|
// ],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Date Format
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may define your models' date format. The following format
|
||||||
|
| is the default format Eloquent uses. You won't see it in your
|
||||||
|
| models unless you change it to a more convenient value.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'date_format' => 'Y-m-d H:i:s',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Pagination
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may define how many models Eloquent should display when
|
||||||
|
| paginating them. The default number is 15, so you might not
|
||||||
|
| see this number in your models unless you change it.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'per_page' => 15,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Base Files
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| By default, your models will be generated in your models path, but
|
||||||
|
| when you generate them again they will be replaced by new ones.
|
||||||
|
| You may want to customize your models and, at the same time, be
|
||||||
|
| able to generate them as your tables change. For that, you
|
||||||
|
| can enable base files. These files will be replaced whenever
|
||||||
|
| you generate them, but your customized files will not be touched.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'base_files' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Snake Attributes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Eloquent treats your model attributes as snake cased attributes, but
|
||||||
|
| if you have camel-cased fields in your database you can disable
|
||||||
|
| that behaviour and use camel case attributes in your models.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'snake_attributes' => true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Indent options
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| As default indention is done with tabs, but you can change it by setting
|
||||||
|
| this to the amount of spaces you that you want to use for indentation.
|
||||||
|
| Usually you will use 4 spaces instead of tabs.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'indent_with_space' => 0,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Qualified Table Names
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| If some of your tables have cross-database relationships (probably in
|
||||||
|
| MySQL), you can make sure your models take into account their
|
||||||
|
| respective database schema.
|
||||||
|
|
|
||||||
|
| Can Either be NULL, FALSE or TRUE
|
||||||
|
| TRUE: Schema name will be prepended on the table
|
||||||
|
| FALSE:Table name will be set without schema name.
|
||||||
|
| NULL: Table name will follow laravel pattern,
|
||||||
|
| i.e. if class name(plural) matches table name, then table name will not be added
|
||||||
|
*/
|
||||||
|
|
||||||
|
'qualified_tables' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Hidden Attributes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When casting your models into arrays or json, the need to hide some
|
||||||
|
| attributes sometimes arise. If your tables have some fields you
|
||||||
|
| want to hide, you can define them bellow.
|
||||||
|
| Some fields were defined for you.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'hidden' => [
|
||||||
|
'*secret*', '*password', '*token',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Mass Assignment Guarded Attributes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| You may want to protect some fields from mass assignment. You can
|
||||||
|
| define them bellow. Some fields were defined for you.
|
||||||
|
| Your fillable attributes will be those which are not in the list
|
||||||
|
| excluding your models' primary keys.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'guarded' => [
|
||||||
|
// 'created_by', 'updated_by'
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Casts
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| You may want to specify which of your table fields should be cast as
|
||||||
|
| something other than a string. For instance, you may want a
|
||||||
|
| text field be cast as an array or and object.
|
||||||
|
|
|
||||||
|
| You may define column patterns which will be cast using the value
|
||||||
|
| assigned. We have defined some fields for you. Feel free to
|
||||||
|
| modify them to fit your needs.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'casts' => [
|
||||||
|
'*_json' => 'json',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Excluded Tables
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When performing the generation of models you may want to skip some of
|
||||||
|
| them, because you don't want a model for them or any other reason.
|
||||||
|
| You can define those tables bellow. The migrations table was
|
||||||
|
| filled for you, since you may not want a model for it.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'except' => [
|
||||||
|
'migrations',
|
||||||
|
'failed_jobs',
|
||||||
|
'password_resets',
|
||||||
|
'personal_access_tokens',
|
||||||
|
'password_reset_tokens',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Specified Tables
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| You can specify specific tables. This will generate the models only
|
||||||
|
| for selected tables, ignoring the rest.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'only' => [
|
||||||
|
// 'users',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Table Prefix
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| If you have a prefix on your table names but don't want it in the model
|
||||||
|
| and relation names, specify it here.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'table_prefix' => '',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Lower table name before doing studly
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| If tables names are capitalised using studly produces incorrect name
|
||||||
|
| this can help fix it ie TABLE_NAME now becomes TableName
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'lower_table_name_first' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Model Names
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| By default the generator will create models with names that match your tables.
|
||||||
|
| However, if you wish to manually override the naming, you can specify a mapping
|
||||||
|
| here between table and model names.
|
||||||
|
|
|
||||||
|
| Example:
|
||||||
|
| A table called 'billing_invoices' will generate a model called `BillingInvoice`,
|
||||||
|
| but you'd prefer it to generate a model called 'Invoice'. Therefore, you'd add
|
||||||
|
| the following array key and value:
|
||||||
|
| 'billing_invoices' => 'Invoice',
|
||||||
|
*/
|
||||||
|
|
||||||
|
'model_names' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Relation Name Strategy
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| How the relations should be named in your models.
|
||||||
|
|
|
||||||
|
| 'related' Use the related table as the relation name.
|
||||||
|
| (post.author --> user.id)
|
||||||
|
generates Post::user() and User::posts()
|
||||||
|
|
|
||||||
|
| 'foreign_key' Use the foreign key as the relation name.
|
||||||
|
| This can help to provide more meaningful relationship names, and avoids naming conflicts
|
||||||
|
| if you have more than one relationship between two tables.
|
||||||
|
| (post.author_id --> user.id)
|
||||||
|
| generates Post::author() and User::posts_where_author()
|
||||||
|
| (post.editor_id --> user.id)
|
||||||
|
| generates Post::editor() and User::posts_where_editor()
|
||||||
|
| ID suffixes can be omitted from foreign keys.
|
||||||
|
| (post.author --> user.id)
|
||||||
|
| (post.editor --> user.id)
|
||||||
|
| generates the same as above.
|
||||||
|
| Where the foreign key matches the related table name, it behaves as per the 'related' strategy.
|
||||||
|
| (post.user_id --> user.id)
|
||||||
|
| generates Post::user() and User::posts()
|
||||||
|
*/
|
||||||
|
|
||||||
|
'relation_name_strategy' => 'related',
|
||||||
|
// 'relation_name_strategy' => 'foreign_key',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Determines need or not to generate constants with properties names like
|
||||||
|
|
|
||||||
|
| ...
|
||||||
|
| const AGE = 'age';
|
||||||
|
| const USER_NAME = 'user_name';
|
||||||
|
| ...
|
||||||
|
|
|
||||||
|
| that later can be used in QueryBuilder like
|
||||||
|
|
|
||||||
|
| ...
|
||||||
|
| $builder->select([User::USER_NAME])->where(User::AGE, '<=', 18);
|
||||||
|
| ...
|
||||||
|
|
|
||||||
|
| that helps to avoid typos in strings when typing field names and allows to use
|
||||||
|
| code competition with available model's field names.
|
||||||
|
*/
|
||||||
|
'with_property_constants' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Optionally includes a full list of columns in the base generated models,
|
||||||
|
| which can be used to avoid making calls like
|
||||||
|
|
|
||||||
|
| ...
|
||||||
|
| \Illuminate\Support\Facades\Schema::getColumnListing
|
||||||
|
| ...
|
||||||
|
|
|
||||||
|
| which can be slow, especially for large tables.
|
||||||
|
*/
|
||||||
|
'with_column_list' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Disable Pluralization Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| You can disable pluralization tables and relations
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'pluralize' => true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Disable Pluralization Except For Certain Tables
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| You can enable pluralization for certain tables
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'override_pluralize_for' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Move $hidden property to base files
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| When base_files is true you can set hidden_in_base_files to true
|
||||||
|
| if you want the $hidden to be generated in base files
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'hidden_in_base_files' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Move $fillable property to base files
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| When base_files is true you can set fillable_in_base_files to true
|
||||||
|
| if you want the $fillable to be generated in base files
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'fillable_in_base_files' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Generate return types for relation methods.
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| When enable_return_types is set to true, return type declarations are added
|
||||||
|
| to all generated relation methods for your models.
|
||||||
|
|
|
||||||
|
| NOTE: This requires PHP 7.0 or later.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'enable_return_types' => false,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Database Specifics
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| In this section you may define the default configuration for each model
|
||||||
|
| that will be generated from a specific database. You can also nest
|
||||||
|
| table specific configurations.
|
||||||
|
| These values will override those defined in the section above.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 'shop' => [
|
||||||
|
// 'path' => app_path(),
|
||||||
|
// 'namespace' => 'App',
|
||||||
|
// 'snake_attributes' => false,
|
||||||
|
// 'qualified_tables' => true,
|
||||||
|
// 'use' => [
|
||||||
|
// Reliese\Database\Eloquent\BitBooleans::class,
|
||||||
|
// ],
|
||||||
|
// 'except' => ['migrations'],
|
||||||
|
// 'only' => ['users'],
|
||||||
|
// // Table Specifics Bellow:
|
||||||
|
// 'user' => [
|
||||||
|
// // Don't use any default trait
|
||||||
|
// 'use' => [],
|
||||||
|
// ]
|
||||||
|
// ],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Connection Specifics
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| In this section you may define the default configuration for each model
|
||||||
|
| that will be generated from a specific connection. You can also nest
|
||||||
|
| database and table specific configurations.
|
||||||
|
|
|
||||||
|
| You may wish to use connection specific config for setting a parent
|
||||||
|
| model with a read only setup, or enforcing a different set of rules
|
||||||
|
| for a connection, e.g. using snake_case naming over CamelCase naming.
|
||||||
|
|
|
||||||
|
| This supports nesting with the following key configuration values, in
|
||||||
|
| reverse precedence order (i.e. the last one found becomes the value).
|
||||||
|
|
|
||||||
|
| connections.{connection_name}.property
|
||||||
|
| connections.{connection_name}.{database_name}.property
|
||||||
|
| connections.{connection_name}.{table_name}.property
|
||||||
|
| connections.{connection_name}.{database_name}.{table_name}.property
|
||||||
|
|
|
||||||
|
| These values will override those defined in the section above.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 'connections' => [
|
||||||
|
// 'read_only_external' => [
|
||||||
|
// 'parent' => \App\Models\ReadOnlyModel::class,
|
||||||
|
// 'connection' => true,
|
||||||
|
// 'users' => [
|
||||||
|
// 'connection' => false,
|
||||||
|
// ],
|
||||||
|
// 'my_other_database' => [
|
||||||
|
// 'password_resets' => [
|
||||||
|
// 'connection' => false,
|
||||||
|
// ]
|
||||||
|
// ]
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
|
];
|
||||||
0
laravel/config/queue.php
Normal file → Executable file
0
laravel/config/queue.php
Normal file → Executable file
84
laravel/config/sanctum.php
Executable file
84
laravel/config/sanctum.php
Executable file
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Laravel\Sanctum\Sanctum;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Stateful Domains
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Requests from the following domains / hosts will receive stateful API
|
||||||
|
| authentication cookies. Typically, these should include your local
|
||||||
|
| and production domains which access your API via a frontend SPA.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
|
||||||
|
'%s%s',
|
||||||
|
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
|
||||||
|
Sanctum::currentApplicationUrlWithPort(),
|
||||||
|
// Sanctum::currentRequestHost(),
|
||||||
|
))),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Sanctum Guards
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This array contains the authentication guards that will be checked when
|
||||||
|
| Sanctum is trying to authenticate a request. If none of these guards
|
||||||
|
| are able to authenticate the request, Sanctum will use the bearer
|
||||||
|
| token that's present on an incoming request for authentication.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'guard' => ['web'],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Expiration Minutes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This value controls the number of minutes until an issued token will be
|
||||||
|
| considered expired. This will override any values set in the token's
|
||||||
|
| "expires_at" attribute, but first-party sessions are not affected.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'expiration' => null,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Token Prefix
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Sanctum can prefix new tokens in order to take advantage of numerous
|
||||||
|
| security scanning initiatives maintained by open source platforms
|
||||||
|
| that notify developers if they commit tokens into repositories.
|
||||||
|
|
|
||||||
|
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Sanctum Middleware
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When authenticating your first-party SPA with Sanctum you may need to
|
||||||
|
| customize some of the middleware Sanctum uses while processing the
|
||||||
|
| request. You may change the middleware listed below as required.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'middleware' => [
|
||||||
|
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
|
||||||
|
'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class,
|
||||||
|
'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
0
laravel/config/services.php
Normal file → Executable file
0
laravel/config/services.php
Normal file → Executable file
0
laravel/config/session.php
Normal file → Executable file
0
laravel/config/session.php
Normal file → Executable file
0
laravel/database/.gitignore
vendored
Normal file → Executable file
0
laravel/database/.gitignore
vendored
Normal file → Executable file
0
laravel/database/factories/BilletFactory.php
Normal file → Executable file
0
laravel/database/factories/BilletFactory.php
Normal file → Executable file
0
laravel/database/factories/UserFactory.php
Normal file → Executable file
0
laravel/database/factories/UserFactory.php
Normal file → Executable file
0
laravel/database/migrations/0001_01_01_000000_create_users_table.php
Normal file → Executable file
0
laravel/database/migrations/0001_01_01_000000_create_users_table.php
Normal file → Executable file
0
laravel/database/migrations/0001_01_01_000001_create_cache_table.php
Normal file → Executable file
0
laravel/database/migrations/0001_01_01_000001_create_cache_table.php
Normal file → Executable file
0
laravel/database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file → Executable file
0
laravel/database/migrations/0001_01_01_000002_create_jobs_table.php
Normal file → Executable file
0
laravel/database/migrations/2025_04_12_110216_create_billets_table.php
Normal file → Executable file
0
laravel/database/migrations/2025_04_12_110216_create_billets_table.php
Normal file → Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('personal_access_tokens', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->morphs('tokenable');
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('token', 64)->unique();
|
||||||
|
$table->text('abilities')->nullable();
|
||||||
|
$table->timestamp('last_used_at')->nullable();
|
||||||
|
$table->timestamp('expires_at')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('personal_access_tokens');
|
||||||
|
}
|
||||||
|
};
|
||||||
0
laravel/database/seeders/BilletSeeder.php
Normal file → Executable file
0
laravel/database/seeders/BilletSeeder.php
Normal file → Executable file
0
laravel/database/seeders/DatabaseSeeder.php
Normal file → Executable file
0
laravel/database/seeders/DatabaseSeeder.php
Normal file → Executable file
0
laravel/licenses/laravel-12.0.3.txt
Normal file → Executable file
0
laravel/licenses/laravel-12.0.3.txt
Normal file → Executable file
0
laravel/package.json
Normal file → Executable file
0
laravel/package.json
Normal file → Executable file
0
laravel/phpunit.xml
Normal file → Executable file
0
laravel/phpunit.xml
Normal file → Executable file
0
laravel/public/.htaccess
Normal file → Executable file
0
laravel/public/.htaccess
Normal file → Executable file
0
laravel/public/favicon.ico
Normal file → Executable file
0
laravel/public/favicon.ico
Normal file → Executable file
0
laravel/public/index.php
Normal file → Executable file
0
laravel/public/index.php
Normal file → Executable file
0
laravel/public/robots.txt
Normal file → Executable file
0
laravel/public/robots.txt
Normal file → Executable file
0
laravel/public/style.css
Normal file → Executable file
0
laravel/public/style.css
Normal file → Executable file
0
laravel/resources/css/app.css
Normal file → Executable file
0
laravel/resources/css/app.css
Normal file → Executable file
0
laravel/resources/js/app.js
Normal file → Executable file
0
laravel/resources/js/app.js
Normal file → Executable file
0
laravel/resources/js/bootstrap.js
vendored
Normal file → Executable file
0
laravel/resources/js/bootstrap.js
vendored
Normal file → Executable file
0
laravel/resources/views/index.blade.php
Normal file → Executable file
0
laravel/resources/views/index.blade.php
Normal file → Executable file
0
laravel/resources/views/welcome.blade.php
Normal file → Executable file
0
laravel/resources/views/welcome.blade.php
Normal file → Executable file
13
laravel/routes/api.php
Executable file
13
laravel/routes/api.php
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use App\Http\Controllers\BilletController;
|
||||||
|
use App\Http\Controllers\CommentaireController;
|
||||||
|
|
||||||
|
Route::get('/user', function (Request $request) {
|
||||||
|
return $request->user();
|
||||||
|
})->middleware('auth:sanctum');
|
||||||
|
|
||||||
|
Route::apiResource('billets', BilletController::class);
|
||||||
|
Route::post('/commentaires',[CommentaireController::class,"store"]);
|
||||||
0
laravel/routes/console.php
Normal file → Executable file
0
laravel/routes/console.php
Normal file → Executable file
2
laravel/routes/web.php
Normal file → Executable file
2
laravel/routes/web.php
Normal file → Executable file
@@ -6,5 +6,3 @@ use Illuminate\Support\Facades\Route;
|
|||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('welcome');
|
return view('welcome');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::resource('billets', BilletController::class);
|
|
||||||
|
|||||||
0
laravel/storage/app/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/app/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/app/private/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/app/private/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/app/public/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/app/public/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/cache/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/cache/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/cache/data/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/cache/data/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/sessions/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/sessions/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/testing/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/testing/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/views/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/views/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/logs/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/logs/.gitignore
vendored
Normal file → Executable file
0
laravel/tests/Feature/ExampleTest.php
Normal file → Executable file
0
laravel/tests/Feature/ExampleTest.php
Normal file → Executable file
0
laravel/tests/TestCase.php
Normal file → Executable file
0
laravel/tests/TestCase.php
Normal file → Executable file
0
laravel/tests/Unit/ExampleTest.php
Normal file → Executable file
0
laravel/tests/Unit/ExampleTest.php
Normal file → Executable file
0
laravel/vite.config.js
Normal file → Executable file
0
laravel/vite.config.js
Normal file → Executable file
Reference in New Issue
Block a user