Merge branch 'brandPage' into campaignPage

This commit is contained in:
Vincent BRIDIER 2023-11-24 16:20:28 +01:00
commit a87342673f
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
23 changed files with 245 additions and 416 deletions

View file

@ -22,12 +22,6 @@ 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
@ -37,25 +31,5 @@ MAIL_ENCRYPTION=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
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
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}"
# Sentry
SENTRY_LARAVEL_DSN=

View file

@ -1,66 +1 @@
<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 [Patreon page](https://patreon.com/taylorotwell).
### Premium Partners
- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Cubet Techno Labs](https://cubettech.com)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[Many](https://www.many.co.uk)**
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
- **[DevSquad](https://devsquad.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[OP.GG](https://op.gg)**
- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
- **[Lendio](https://lendio.com)**
## 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).
# MesBR

View file

View file

@ -4,26 +4,62 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Str;
/**
* Basket
*
* @property integer $id Basket Id.
* @property string $reference Basket Reference.
* @property integer $customer_id Basket Cutomer Id.
* @property-read \Carbon\Carbon $created_at Created date.
* @property-read \Carbon\Carbon $updated_at Updated date.
*
* * RELATIONS
* @property-read \App\Models\Customer $customer The content owned by the Basket
* @property-read \App\Models\BasketsContent $content The customer that owns the Basket
*/
class Basket extends Model
{
use HasFactory;
/**
* Fillable
*
* @var string[]
*/
protected $fillable = [
'reference',
'customer_id',
'campaign_id'
];
/**
* Get the content owned by the Basket
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function content(): HasMany
{
return $this->hasMany(BasketsContent::class);
}
/**
* Get the customer that owns the Basket
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function customer(): BelongsTo
{
return $this->belongsTo(Customer::class);
}
/**
* The "booted" method of the model.
*
* @return void
*/
protected static function booted(): void
{

View file

@ -10,11 +10,21 @@ class BasketsContent extends Model
{
use HasFactory;
/**
* Get the basket that owns the BasketContent
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function basket(): BelongsTo
{
return $this->belongsTo(Basket::class);
}
/**
* Get the coupon owned by the BasketContent
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function coupon(): BelongsTo
{
return $this->BelongsTo(Coupon::class);

View file

@ -2,12 +2,9 @@
namespace App\Models;
use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Facades\Crypt;
use App\Lib\Helpers\FileStorageHelper;
class Brand extends Model
@ -28,50 +25,27 @@ class Brand extends Model
'crm_password'
];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'crm_token' => 'encrypted',
'crm_password' => 'encrypted',
];
/**
* Get campaign that owned by the Brand
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function campaigns(): HasMany
{
return $this->hasMany(Campaign::class);
}
/**
* Interact with the brand's crm_token.
*/
protected function crmToken(): Attribute
{
return Attribute::make(
get: function (string $value) {
try {
$decrypted = Crypt::decryptString($value);
} catch (DecryptException $e) {
report($e);
$decrypted = null;
}
return $decrypted;
},
set: fn (string $value) => Crypt::encryptString($value),
);
}
/**
* Interact with the brand's crm_password.
*/
protected function crmPassword(): Attribute
{
return Attribute::make(
get: function (string $value) {
try {
$decrypted = Crypt::decryptString($value);
} catch (DecryptException $e) {
report($e);
$decrypted = null;
}
return $decrypted;
},
set: fn (string $value) => Crypt::encryptString($value),
);
}
// * EVENTS
/**

View file

@ -34,11 +34,23 @@ class Campaign extends Model
'status' => 'bool'
];
// * RELATIONS
/**
* Get the brand that owns the Campaign
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function brand(): BelongsTo
{
return $this->belongsTo(Brand::class);
}
/**
* Get coupons that owned by the Campaign
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function coupons(): BelongsToMany
{
return $this->belongsToMany(Coupon::class);

View file

@ -44,10 +44,9 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
*/
class Coupon extends Model
{
use HasFactory;
// FIXME : Ajouter les mouvement de quantité, mettre juste une colonne et se servir des logs avec un type pour mouvement ?
// FIXME / Ajouter logs impressions.
// FIXME : Ajouter logs impressions.
use HasFactory;
/**
* The attributes that are mass assignable.
@ -125,7 +124,7 @@ class Coupon extends Model
// * RELATIONSHIPS
/**
* The campaigns that belong to the Coupon
* Get campaigns that owns the Coupon
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
@ -162,26 +161,27 @@ class Coupon extends Model
}
/**
* Get can be used
* Check if coupon can be used taking account multiple factors
*
* @return boolean
*/
public function checkIfCanBeUsed()
public function checkIfCanBeUsed(): bool
{
if (
(!is_null($this->start_diffusion_date) and
(
is_null($this->start_diffusion_date) or
$this->start_diffusion_date->lessThanOrEqualTo(Carbon::now())
) and
(!is_null($this->end_diffusion_date) and
$this->end_diffusion_date->greaterThanOrEqualTo(Carbon::now())
) and
(!is_null($this->end_validity_date) and
$this->end_validity_date->greaterThanOrEqualTo(Carbon::now()->addDays($this->validity_period)))
(
is_null($this->end_diffusion_date) or
$this->end_diffusion_date->greaterThanOrEqualTo(Carbon::now())) and
(is_null($this->end_validity_date) or
$this->end_validity_date->greaterThanOrEqualTo(Carbon::now()->addDays($this->validity_period))
)
) {
return true;
}
// FIXME : Ajouter calendrier de diffusion et le prendre en compte dans la condition
// FIXME : Ajouter calendrier de diffusion et le prendre en compte dans la condition.
return false;
}
}

View file

@ -9,6 +9,11 @@ class CouponLog extends Model
{
use HasFactory;
/**
* Fillable
*
* @var string[]
*/
protected $fillable = [
'coupon_id',
'campaign_id',

View file

@ -9,6 +9,11 @@ class Customer extends Model
{
use HasFactory;
/**
* Fillable
*
* @var string[]
*/
protected $fillable = [
'hashcode',
'email'

View file

@ -35,7 +35,7 @@ class AppServiceProvider extends ServiceProvider
return request()->getClientIp();
} else {
return request()->server('HTTP_X_FORWARDED_FOR') ??
request()->getClientIp();
request()->getClientIp();
}
});
@ -61,9 +61,9 @@ class AppServiceProvider extends ServiceProvider
// * FORCE BOOTSTRAP PAGINATOR (or custom if in front)
// Early boot, request wont be filled as expected.
if (collect(explode('/', \request()->getPathInfo()))->get(1) === 'bo') {
Paginator::useBootstrap();
Paginator::useBootstrapFive();
} else {
Paginator::useBootstrap();
Paginator::useBootstrapFive();
}
}
}

View file

@ -1,14 +1,14 @@
{
"name": "laravel/laravel",
"name": "uwil/mesbr",
"type": "project",
"description": "The Laravel Framework.",
"description": "BR management application.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^8.1",
"php": "^8.2",
"diglactic/laravel-breadcrumbs": "^8.0",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.0",
@ -20,15 +20,13 @@
"require-dev": {
"fakerphp/faker": "^1.9.1",
"kitloong/laravel-migrations-generator": "^6.8",
"krlove/eloquent-model-generator": "dev-l10-compatibility",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.0",
"slevomat/coding-standard": "^8.10",
"spatie/laravel-ignition": "^2.0",
"thedoctor0/laravel-factory-generator": "^1.2"
"spatie/laravel-ignition": "^2.0"
},
"autoload": {
"psr-4": {
@ -37,12 +35,7 @@
"Database\\Seeders\\": "database/seeders/"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/laravel-shift/eloquent-model-generator.git"
}
],
"repositories": [],
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"

152
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "a7500b4c46c60cc929e9c3e85844d175",
"content-hash": "246d8cf8d2b528e7b07ee0ef3a355bdf",
"packages": [
{
"name": "brick/math",
@ -7582,90 +7582,6 @@
],
"time": "2023-03-26T07:37:00+00:00"
},
{
"name": "krlove/code-generator",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/krlove/code-generator.git",
"reference": "1ac521f5ef79a376282e3315ba6a13a83c63fb9a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/krlove/code-generator/zipball/1ac521f5ef79a376282e3315ba6a13a83c63fb9a",
"reference": "1ac521f5ef79a376282e3315ba6a13a83c63fb9a",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-4": {
"Krlove\\CodeGenerator\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Code Generator",
"support": {
"issues": "https://github.com/krlove/code-generator/issues",
"source": "https://github.com/krlove/code-generator/tree/1.0.1"
},
"time": "2022-02-20T12:24:22+00:00"
},
{
"name": "krlove/eloquent-model-generator",
"version": "dev-l10-compatibility",
"source": {
"type": "git",
"url": "https://github.com/laravel-shift/eloquent-model-generator.git",
"reference": "d8f0280de04d85cf2991e5a5dd317f5dea239d95"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel-shift/eloquent-model-generator/zipball/d8f0280de04d85cf2991e5a5dd317f5dea239d95",
"reference": "d8f0280de04d85cf2991e5a5dd317f5dea239d95",
"shasum": ""
},
"require": {
"doctrine/dbal": "^3.5",
"illuminate/config": "^10.0",
"illuminate/console": "^10.0",
"illuminate/database": "^10.0",
"illuminate/support": "^10.0",
"krlove/code-generator": "^1.0",
"php": "^8.1"
},
"require-dev": {
"phpunit/phpunit": "^9.5.10"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Krlove\\EloquentModelGenerator\\Provider\\GeneratorServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Krlove\\EloquentModelGenerator\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Krlove\\Tests\\Integration\\": "tests/integration"
}
},
"license": [
"MIT"
],
"description": "Eloquent Model Generator",
"support": {
"source": "https://github.com/laravel-shift/eloquent-model-generator/tree/l10-compatibility"
},
"time": "2023-01-30T20:15:06+00:00"
},
{
"name": "laravel/pint",
"version": "v1.8.0",
@ -10124,68 +10040,6 @@
],
"time": "2023-02-16T09:57:23+00:00"
},
{
"name": "thedoctor0/laravel-factory-generator",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/TheDoctor0/laravel-factory-generator.git",
"reference": "890d2b8bac282e7595db747e77daff3ff9b871ec"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TheDoctor0/laravel-factory-generator/zipball/890d2b8bac282e7595db747e77daff3ff9b871ec",
"reference": "890d2b8bac282e7595db747e77daff3ff9b871ec",
"shasum": ""
},
"require": {
"doctrine/dbal": "^2.9|^2.10|^3.0",
"illuminate/console": "^8.0|^9.0|^10.0",
"illuminate/filesystem": "^8.0|^9.0|^10.0",
"illuminate/support": "^8.0|^9.0|^10.0",
"php": ">=7.4"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"TheDoctor0\\LaravelFactoryGenerator\\FactoryGeneratorServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"TheDoctor0\\LaravelFactoryGenerator\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Automatically generate Laravel factories for your models.",
"keywords": [
"factories",
"factory",
"generator",
"laravel",
"tests"
],
"support": {
"issues": "https://github.com/TheDoctor0/laravel-factory-generator/issues",
"source": "https://github.com/TheDoctor0/laravel-factory-generator/tree/1.3.0"
},
"funding": [
{
"url": "https://www.paypal.me/thedoctor0",
"type": "custom"
},
{
"url": "https://github.com/thedoctor0",
"type": "github"
}
],
"time": "2023-03-08T18:25:21+00:00"
},
{
"name": "theseer/tokenizer",
"version": "1.2.1",
@ -10239,9 +10093,7 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"krlove/eloquent-model-generator": 20
},
"stability-flags": [],
"prefer-stable": true,
"prefer-lowest": false,
"platform": {

View file

@ -25,15 +25,15 @@ class BrandFactory extends Factory
public function definition()
{
return [
'name' => $this->faker->unique()->company(),
'contact_mail' => $this->faker->unique()->email(),
'name' => fake()->unique()->company(),
'contact_mail' => fake()->unique()->email(),
'rcs' => \sprintf(
'RCS %s B %s',
$this->faker->unique()->city(),
$this->faker->randomNumber(9, true)
fake()->unique()->city(),
fake()->randomNumber(9, true)
),
'crm_token' => $this->faker->uuid(),
'crm_password' => $this->faker->uuid()
'crm_token' => fake()->uuid(),
'crm_password' => fake()->uuid()
];
}
}

View file

@ -8,6 +8,8 @@ return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -37,6 +39,8 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -8,6 +8,8 @@ return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -17,14 +19,16 @@ return new class extends Migration
$table->string('contact_mail')->comment("Adresse email de contact");
$table->string('rcs')->comment("RCS");
$table->string('logo')->comment("Path vers le logo - 135x70px JPG");
$table->string('crm_token', 500)->comment("CRM Token encrypté");
$table->string('crm_password', 500)->comment("CRM Password encrypté");
$table->string('crm_token', 280)->comment("CRM Token encrypté");
$table->string('crm_password', 280)->comment("CRM Password encrypté");
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -8,6 +8,8 @@ return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
@ -19,6 +21,8 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -8,13 +8,15 @@ return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Schema::create('customers', function (Blueprint $table) {
$table->id();
$table->string('hashcode', 36);
$table->string('email', 255);
$table->string('email');
$table->timestamps();
$table->unique(['hashcode', 'email']);
});
@ -22,6 +24,8 @@ return new class extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{

View file

@ -1,36 +1,41 @@
@extends('bo.layout')
@section('title', sprintf('%s - %s', Str::singular(__('models.classes.brands')), Str::ucfirst(__('create'))))
@section('description', __('Creation of a new brand.'))
@section('description', __('Création d\'une nouvelle marque.'))
@section('breadcrumb', request()->route()->getName())
@section('breadcrumb',
request()->route()->getName())
@section('content')
<div class="card">
<div class="card-header">
<div class="row">
<div class="col">
<h1 class="col h2">
<a href="{{ route('bo.brands.index') }}" class="btn btn-primary text-decoration-none m-0" data-bs="tooltip" data-bs-placement="top" title="{{ __('Return to the :model list', ['model' => __('models.classes.brands')]) }}" data-bs-toggle="tooltip">
<i class="fa-solid fa-arrow-left"></i>
</a>
<span class="fw-bold">{{ Str::singular(__('models.classes.brands')) }}</span>&nbsp;<small class="text-muted">{{ __('create') }}</small>
</h1>
</div>
</div>
</div>
<div class="card-body bg-light">
<form id="formSubmit" action="{{ route('bo.brands.store') }}" method="POST" enctype="multipart/form-data">
@csrf
@include('bo.pages.brands.form-inputs')
<div class="card">
<div class="card-header">
<div class="row">
<div class="col text-center">
<button type="submit" class="btn btn-primary" title="{{ __('Save :model', ['model' => Str::singular(__('models.classes.brands'))]) }}" data-bs-toggle="tooltip">
{{ __('crud.actions.save') }}
</button>
<div class="col">
<h1 class="col h2">
<a class="btn btn-primary text-decoration-none m-0" data-bs="tooltip" data-bs-placement="top" data-bs-toggle="tooltip"
href="{{ route('bo.brands.index') }}"
title="{{ __('Return to the :model list', ['model' => __('models.classes.brands')]) }}">
<i class="fa-solid fa-arrow-left"></i>
</a>
<span class="fw-bold">{{ Str::singular(__('models.classes.brands')) }}</span>&nbsp;<small
class="text-muted">{{ __('create') }}</small>
</h1>
</div>
</div>
</form>
</div>
<div class="card-body bg-light">
<form id="formSubmit" action="{{ route('bo.brands.store') }}" method="POST" enctype="multipart/form-data">
@csrf
@include('bo.pages.brands.form-inputs')
<div class="row">
<div class="col text-center">
<button class="btn btn-primary" data-bs-toggle="tooltip" type="submit"
title="{{ __('Save :model', ['model' => Str::singular(__('models.classes.brands'))]) }}">
{{ __('crud.actions.save') }}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection

View file

@ -1,37 +1,43 @@
@extends('bo.layout', ['brParam' => $brandModel])
@section('title', sprintf('%s - %s %s', Str::singular(__('models.classes.brands')), Str::ucfirst(__('crud.actions.edit')), $brandModel->seo_title))
@section('description', $brandModel->seo_description)
@section('title', sprintf('%s - %s %s', Str::singular(__('models.classes.brands')), Str::ucfirst(__('crud.actions.edit')),
$brandModel->name))
@section('description', __('crud.actions.edit'))
@section('breadcrumb', request()->route()->getName())
@section('breadcrumb',
request()->route()->getName())
@section('content')
<div class="card">
<div class="card-header">
<div class="row">
<div class="col">
<h1 class="col h2">
<a href="{{ route('bo.brands.index') }}" class="btn btn-primary text-decoration-none m-0" data-bs="tooltip" data-bs-placement="top" title="{{ __('Return to the :model list', ['model' => __('models.classes.brands')]) }}" data-bs-toggle="tooltip">
<i class="fa-solid fa-arrow-left"></i>
</a>
<span class="fw-bold">{{ Str::singular(__('models.classes.brands')) }}</span>&nbsp;<small class="text-muted">{{ __('crud.actions.edit') }}</small>
</h1>
</div>
</div>
</div>
<div class="card-body bg-light">
<form id="formSubmit" action="{{ route('bo.brands.update', $brandModel->id) }}" method="POST" enctype="multipart/form-data">
@csrf
@method('PUT')
@include('bo.pages.brands.form-inputs', ['model' => $brandModel])
<div class="card">
<div class="card-header">
<div class="row">
<div class="col text-center">
<button type="submit" class="btn btn-primary" title="{{ __('Save :model', ['model' => Str::singular(__('models.classes.brands'))]) }}" data-bs-toggle="tooltip">
{{ __('crud.actions.save') }}
</button>
<div class="col">
<h1 class="col h2">
<a class="btn btn-primary text-decoration-none m-0" data-bs="tooltip" data-bs-placement="top" data-bs-toggle="tooltip"
href="{{ route('bo.brands.index') }}"
title="{{ __('Return to the :model list', ['model' => __('models.classes.brands')]) }}">
<i class="fa-solid fa-arrow-left"></i>
</a>
<span class="fw-bold">{{ Str::singular(__('models.classes.brands')) }}</span>&nbsp;<small
class="text-muted">{{ __('crud.actions.edit') }}</small>
</h1>
</div>
</div>
</form>
</div>
<div class="card-body bg-light">
<form id="formSubmit" action="{{ route('bo.brands.update', $brandModel->id) }}" method="POST" enctype="multipart/form-data">
@csrf
@method('PUT')
@include('bo.pages.brands.form-inputs', ['model' => $brandModel])
<div class="row">
<div class="col text-center">
<button class="btn btn-primary" data-bs-toggle="tooltip" type="submit"
title="{{ __('Save :model', ['model' => Str::singular(__('models.classes.brands'))]) }}">
{{ __('crud.actions.save') }}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection

View file

@ -1,53 +1,59 @@
<div class="table-responsive">
<table class="table fix-action m-0">
<table class="fix-action m-0 table">
<thead>
@php
$cols = [
'name' => __('validation.attributes.name'),
'contact_mail' => __('validation.attributes.contact_mail'),
'rcs' => __('validation.attributes.rcs'),
'logo' => __('validation.attributes.logo'),
'crm_token' => __('validation.attributes.crm_token'),
'crm_password' => __('validation.attributes.crm_password'),
'updated_at' => __('validation.attributes.updated_at')];
$cols = [
'name' => __('validation.attributes.name'),
'contact_mail' => __('validation.attributes.contact_mail'),
'rcs' => __('validation.attributes.rcs'),
'logo' => __('validation.attributes.logo'),
'crm_token' => __('validation.attributes.crm_token'),
'crm_password' => __('validation.attributes.crm_password'),
'updated_at' => __('validation.attributes.updated_at'),
];
@endphp
@include('bo.modules.table-col-sorter', [ 'cols' => $cols, 'mobileHide' => ['status']])
@include('bo.modules.table-col-sorter', ['cols' => $cols, 'mobileHide' => ['status']])
</thead>
<tbody>
@if($brandModels->count())
@foreach ($brandModels as $brandModel)
<tr>
<td class="align-middle">{{ $brandModel->name }}</td>
<td class="align-middle">{{ $brandModel->contact_mail }}</td>
<td class="align-middle">{{ $brandModel->rcs }}</td>
<td class="align-middle">{{ $brandModel->logo }}</td>
<td class="align-middle">{{ $brandModel->crm_token }}</td>
<td class="align-middle">{{ $brandModel->crm_password }}</td>
<td class="align-middle">
<span class="badge bg-warning text-dark text-wrap">{{ $brandModel->updated_at->formatLocalized('%d/%m/%Y à %H:%M') }}</span>
</td>
<td class="align-middle">
<form action="{{ route('bo.brands.destroy', $brandModel->id) }}" method="POST" class="btn-group confirmDeleteJS" novalidate>
<a class="btn btn-sm btn-primary" href="{{ route('bo.brands.edit', $brandModel->id) }}" title="{{ __('crud.helpers.update_model', ['model' => Str::singular(__('models.classes.brands'))]) }}" data-bs-toggle="tooltip">
<i class="fa-solid fa-pencil"></i>
</a>
@method('DELETE')
@csrf
<div class="btn-group" role="group">
<button class="btn btn-sm btn-danger" title="{{ __('crud.helpers.delete_model', ['model' => Str::singular(__('models.classes.brands'))]) }}" data-bs-toggle="tooltip">
<i class="fa-solid fa-trash"></i>
</button>
</div>
</form>
</td>
</tr>
@endforeach
@if ($brandModels->count())
@foreach ($brandModels as $brandModel)
<tr>
<td class="align-middle">{{ $brandModel->name }}</td>
<td class="align-middle">{{ $brandModel->contact_mail }}</td>
<td class="align-middle">{{ $brandModel->rcs }}</td>
<td class="align-middle">{{ $brandModel->logo }}</td>
<td class="align-middle">{{ $brandModel->crm_token }}</td>
<td class="align-middle">{{ $brandModel->crm_password }}</td>
<td class="align-middle">
<span
class="badge bg-warning text-dark text-wrap">{{ $brandModel->updated_at->formatLocalized('%d/%m/%Y à %H:%M') }}</span>
</td>
<td class="align-middle">
<form class="btn-group confirmDeleteJS" action="{{ route('bo.brands.destroy', $brandModel->id) }}"
method="POST" novalidate>
<a class="btn btn-sm btn-primary" data-bs-toggle="tooltip"
href="{{ route('bo.brands.edit', $brandModel->id) }}"
title="{{ __('crud.helpers.update_model', ['model' => Str::singular(__('models.classes.brands'))]) }}">
<i class="fa-solid fa-pencil"></i>
</a>
@method('DELETE')
@csrf
<div class="btn-group" role="group">
<button class="btn btn-sm btn-danger" data-bs-toggle="tooltip"
title="{{ __('crud.helpers.delete_model', ['model' => Str::singular(__('models.classes.brands'))]) }}">
<i class="fa-solid fa-trash"></i>
</button>
</div>
</form>
</td>
</tr>
@endforeach
@else
<tr>
<td colspan="9" class="text-center">
<span class="h3">{{ __('crud.helpers.no_results', ['models' => __('models.classes.brands') ])}}</span>
</td>
</tr>
<tr>
<td class="text-center" colspan="9">
<span class="h3">{{ __('crud.helpers.no_results', ['model' => __('models.classes.brands')]) }}</span>
</td>
</tr>
@endif
</tbody>
</table>