Compare commits

..

No commits in common. "master" and "remove-handler-add-sentry" have entirely different histories.

231 changed files with 3031 additions and 11497 deletions

View file

@ -21,13 +21,6 @@ DB_DATABASE_2016=legaulois2016
DB_USERNAME_2016=
DB_PASSWORD_2016=
## DATABASE OPINSTA
DB_DATABASE_OPINSTA=
DB_USERNAME_OPINSTA=
DB_PASSWORD_OPINSTA=
DB_HOST_OPINSTA=
DB_PORT_OPINSTA=
## MIGRATION
MIGRATIONPAGINATION=20000
@ -77,14 +70,6 @@ MESBR_COUPON_3_CHARCUT=""
ANALYTICS_GOOGLE_ID=
GOOGLE_MAP_API_KEY=
# Google Recaptcha
GOOGLE_RECAPTCHA_PUBLIC=
GOOGLE_RECAPTCHA_PRIVATE=
GOOGLE_RECAPTCHA_VERSION=
# Matomo
MATOMO_SITE_ID=
## MERCANET
MERCANET_SECRET=
MERCANET_MERCHAND_ID=
@ -92,9 +77,3 @@ MERCANET_ENV=
# BYPASS THE CRM JUST LOGIN (needs debug mode)
NOCRM=false
#OP INSTA
## Démarre le à d-m-YYYY
OPINSTA_START=
## Fin le à d-m-YYYY
OPINSTA_END=

1
.gitignore vendored
View file

@ -29,4 +29,3 @@ mix-manifest.json
workspace.code-workspace
storage/crm_migration.csv
auth.json
.npmrc

View file

@ -1,11 +1,74 @@
include:
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'lint/lint7.3.yml'
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'security/security7.3.yml'
stages:
- lint
- security
- Security
- CodingStandards
- Builds
composer-security:
stage: Security
image: $CI_REGISTRY/service-web-lab/ldc-web-images-docker/ldcweb-qa:php7.3-1.0
script:
- local-php-security-checker --format=json --path=./composer.lock > composer-security-checker-report.json
artifacts:
when: on_failure
expose_as: 'composer-security-checker'
paths:
- composer-security-checker-report.json
allow_failure: true
needs: []
npm-security:
stage: Security
image: node:17.9.1
before_script:
- npm install --location=global audit-ci@^6
script:
- audit-ci -p npm -o json > npm-security-checker-report.json
artifacts:
when: on_failure
expose_as: 'npm-security-checker'
paths:
- npm-security-checker-report.json
allow_failure: true
needs: []
phpcs:
stage: CodingStandards
image: $CI_REGISTRY/service-web-lab/ldc-web-images-docker/ldcweb-qa:php7.3-1.0
before_script:
- composer config gitlab-token.gitlab.com $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
- composer install
cache:
paths:
- vendor/
script:
- vendor/bin/phpcs --report=junit --report-file=phpcs-report.xml
artifacts:
when: on_failure
expose_as: 'phpcs'
paths:
- phpcs-report.xml
reports:
junit: phpcs-report.xml
allow_failure: false
needs:
- composer-security
- npm-security
front-build:
stage: Builds
image: node:17.9.1
before_script:
- npm install
cache:
paths:
- node_modules/
script:
- npm run prod > front-build-report.json
artifacts:
when: on_failure
expose_as: 'front-build-report'
paths:
- front-build-report.json
allow_failure: false
needs:
- phpcs

View file

@ -1,11 +0,0 @@
## Comportement constaté
## Comportement attendu
## Solution envisagée
## Étapes pour la reproduction du bug
*

View file

@ -1,7 +0,0 @@
## Présentation du besoin
## Implémentation
## Maquettes, documentations...

View file

@ -16,6 +16,7 @@ use App\Jobs\DeleteOldNotifications;
use App\Jobs\DeleteOrders;
use App\Jobs\PurgeNotifications as JobsPurgeNotifications;
use App\Jobs\PurgeOldResetPasswords;
use App\Jobs\SendOcbMissingBreederReminder;
use App\Jobs\UpdateReductions as JobsUpdateReductions;
use App\Jobs\XmlEleveursReader as JobsXmlEleveursReader;
use App\Jobs\XmlIncoReader as JobsXmlIncoReader;
@ -51,19 +52,19 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
// $schedule->job(SendOcbMissingBreederReminder::class)->dailyAt('07:30');
//$schedule->job(SendOcbMissingBreederReminder::class)->onOneServer()->dailyAt('07:30');
$schedule->job(DeleteOrders::class)->dailyAt('14:00');
$schedule->job(DeleteOldMessages::class)->dailyAt('14:15');
$schedule->job(DeleteOldNotifications::class)->dailyAt('14:30');
$schedule->job(JobsUpdateReductions::class)->dailyAt('14:45');
$schedule->job(JobsXmlIncoReader::class)->name('xml-inco-reader')->dailyAt('15:00');
$schedule->job(JobsXmlTracaReader::class)->name('xml-traca-reader')->dailyAt('15:15');
$schedule->job(JobsXmlEleveursReader::class)->name('xml-eleveurs-reader')->dailyAt('15:30');
$schedule->job(JobsXSCVMepReader::class)->name('csv-mep-reader')->dailyAt('16:00');
$schedule->job(JobsXmlIncoReader::class)->name('xml-inco-reader')->onOneServer()->dailyAt('15:00');
$schedule->job(JobsXmlTracaReader::class)->name('xml-traca-reader')->onOneServer()->dailyAt('15:15');
$schedule->job(JobsXmlEleveursReader::class)->name('xml-eleveurs-reader')->onOneServer()->dailyAt('15:30');
$schedule->job(JobsXSCVMepReader::class)->name('csv-mep-reader')->onOneServer()->dailyAt('16:00');
$schedule->job(JobsPurgeNotifications::class)->dailyAt('00:15');
$schedule->job(PurgeOldResetPasswords::class)->dailyAt('00:25');
// * Remove Old traca
$schedule->command('xml:clean_olds')->dailyAt('06:00');
$schedule->command('xml:clean_olds')->onOneServer()->dailyAt('06:00');
}
}

View file

@ -13,11 +13,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class ArticleCategory extends BaseEnumRoutable
{
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class BreedingBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -22,11 +17,6 @@ final class BreedingBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class ContactFormCivility extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -23,11 +18,6 @@ final class ContactFormCivility extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -36,11 +26,6 @@ final class ContactFormCivility extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -52,7 +52,6 @@ final class ContactFormType extends BaseEnumRoutable
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string

View file

@ -16,11 +16,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class Days extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -35,11 +30,6 @@ final class Days extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -54,11 +44,6 @@ final class Days extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -6,11 +6,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
abstract class Departaimant extends BaseEnumRoutable
{
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class DepartaimantCollectionType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -23,11 +18,6 @@ final class DepartaimantCollectionType extends BaseEnumRoutable
];
}
/**
* Enum label
*
* @return array
*/
protected static function labels(): array
{
return [
@ -36,11 +26,6 @@ final class DepartaimantCollectionType extends BaseEnumRoutable
];
}
/**
* Json serialize implementation.
*
* @return array
*/
public function jsonSerialize(): array
{
return [

View file

@ -107,11 +107,6 @@ namespace App\Enums;
*/
final class DepartaimantCurrent extends Departaimant
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -219,11 +214,6 @@ final class DepartaimantCurrent extends Departaimant
];
}
/**
* Enum label
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,11 +12,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class DepartaimantStatus extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -27,11 +22,6 @@ final class DepartaimantStatus extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -42,21 +32,11 @@ final class DepartaimantStatus extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;
}
/**
* To Array
*
* @return \Kwaadpepper\Enum\BaseEnum[]
*/
public static function toArray(): array
{
$array = [];
@ -69,11 +49,6 @@ final class DepartaimantStatus extends BaseEnumRoutable
return $array;
}
/**
* Json serialize implementation.
*
* @return array
*/
public function jsonSerialize(): array
{
return [

View file

@ -105,11 +105,6 @@ namespace App\Enums;
*/
final class DepartaimantVintage extends Departaimant
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -215,11 +210,6 @@ final class DepartaimantVintage extends Departaimant
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,11 +12,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class EleveurOcbStatus extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -26,12 +21,6 @@ final class EleveurOcbStatus extends BaseEnumRoutable
'yes' => 3
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -42,11 +31,6 @@ final class EleveurOcbStatus extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -13,11 +13,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class EngagementBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -29,11 +24,6 @@ final class EngagementBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class EngagementType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -23,11 +18,6 @@ final class EngagementType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class GMapDataType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [

View file

@ -12,11 +12,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class GeneralConfigType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -27,11 +22,6 @@ final class GeneralConfigType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class GeoType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -23,11 +18,6 @@ final class GeoType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -21,11 +21,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class InputType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [

View file

@ -13,11 +13,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class NotificationType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -29,11 +24,6 @@ final class NotificationType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -18,11 +18,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class NutritionBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -34,11 +29,6 @@ final class NutritionBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class NutritionPageType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -23,11 +18,6 @@ final class NutritionPageType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -5,32 +5,25 @@ namespace App\Enums;
use Kwaadpepper\Enum\BaseEnumRoutable;
/**
* @method static self egg()
* @method static self rabbit()
* @method static self poultry()
*/
final class OCBType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
'egg' => 0,
'rabbit' => 1,
'poultry' => 2
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
'egg' => __('Oeuf'),
'rabbit' => __('Lapin'),
'poultry' => __('Volaille')
];

View file

@ -13,11 +13,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class OrderStatus extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -29,11 +24,6 @@ final class OrderStatus extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class OrderType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -23,11 +18,6 @@ final class OrderType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,11 +12,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class PoultryBlocType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -25,11 +20,6 @@ final class PoultryBlocType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class PoultryPageType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -23,11 +18,6 @@ final class PoultryPageType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class PresentationType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -23,11 +18,6 @@ final class PresentationType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -19,11 +19,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RangeColor extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -40,12 +35,6 @@ final class RangeColor extends BaseEnumRoutable
'color11' => 'color-11'
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,11 +12,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeDifficulty extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -27,11 +22,6 @@ final class RecipeDifficulty extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [
@ -42,11 +32,6 @@ final class RecipeDifficulty extends BaseEnumRoutable
];
}
/**
* Output the value as a string
*
* @return string
*/
public function __toString(): string
{
return (string)$this->label;

View file

@ -13,11 +13,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeFilter extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
$labels = self::labels();
@ -29,11 +24,6 @@ final class RecipeFilter extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -12,11 +12,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeFilterTimes extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
$labels = self::labels();
@ -27,11 +22,6 @@ final class RecipeFilterTimes extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -10,11 +10,6 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
*/
final class RecipeType extends BaseEnumRoutable
{
/**
* Enum values
*
* @return array
*/
protected static function values(): array
{
return [
@ -23,11 +18,6 @@ final class RecipeType extends BaseEnumRoutable
];
}
/**
* Enum labels
*
* @return array
*/
protected static function labels(): array
{
return [

View file

@ -7,7 +7,6 @@ use Exception;
/**
* This class Exception is used to skip a row import from
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class AbortContactMailer extends Exception

View file

@ -7,7 +7,6 @@ use Exception;
/**
* This class Exception is used to skip a row import from
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class AbortRowImportException extends Exception

View file

@ -7,7 +7,6 @@ use Exception;
/**
* This class Exception is used in CB payement process
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class CBPayementError extends Exception

View file

@ -1,9 +0,0 @@
<?php
namespace App\Exceptions;
use Exception;
class InstaApiLimitReachedException extends Exception
{
}

View file

@ -7,7 +7,6 @@ use Exception;
/**
* This class Exception is used to skip a row import from
* database migration (2016 -> 2020)
*
* @author Jérémy Munsch <jeremy.munsch@ldc.fr>
*/
class RedirectTo extends Exception

View file

@ -5,36 +5,26 @@ namespace App\Http\Controllers;
use App\Enums\GeneralConfigType;
use App\Models\Actu;
use App\Models\Tag;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Cache;
class ActuController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Contracts\View\View
*/
public function index()
{
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\Tag> */
$tags = Tag::query()->whereHas('actus', function (Builder $q) {
$q->where('status', true);
})->get();
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\Actu> */
$actus = Actu::query()->where('status', true)
$tags = Tag::has('actus')->get();
$actus = Actu::where('status', true)
->with('tags:id')
->orderBy('created_at', 'DESC')
->get(['id'])
->map(function ($actu) {
->mapWithKeys(function ($actu) {
return [
'id' => $actu->id,
'tags' => $actu->tags->map(function ($tag) {
return $tag->id;
})->all()
$actu->id => [
'id' => $actu->id,
'tags' => $actu->tags->mapWithKeys(function ($tag) {
return [$tag->id => $tag->id];
})->all()
]
];
})->all();
$generalConfig = app()->view->getShared()['GeneralConfigGlobal'] ?? null;
$generalConfig = $generalConfig ? $generalConfig->where('type', GeneralConfigType::actu())->first() : null;
return view('front.actu.index', [
@ -45,12 +35,6 @@ class ActuController extends Controller
]);
}
/**
* Display a news
*
* @param \App\Models\Actu $actu
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/
public function view(Actu $actu)
{
$relatedActus = Actu::whereHas('tags', function ($q) use ($actu) {
@ -66,12 +50,6 @@ class ActuController extends Controller
]);
}
/**
* Render a news for JS usage (ajax)
*
* @param \App\Models\Actu $actu
* @return string Base64 rendered view.
*/
public function renderActu(Actu $actu)
{
if (!request()->wantsJson()) {

View file

@ -40,8 +40,8 @@ class AuthController extends Controller
/**
* Enregistre le customer dans la base de données
*
* @param \App\Http\Requests\CustomerRegisterRequest $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
* @param CustomerRegisterRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function registerSubmit(CustomerRegisterRequest $request)
{
@ -143,7 +143,6 @@ class AuthController extends Controller
/**
* Retourne la page de connexion
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/
@ -254,11 +253,9 @@ class AuthController extends Controller
/**
* Handle Api error exception
*
* @param \LDC\LDCCRM\Exceptions\ApiErrorException $e
* @param \App\Http\Requests\LoginRequest $request
* @param ApiErrorException $e
* @param LoginRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Exception Exception.
*/
private function handleLoginApiErrorException(ApiErrorException $e, LoginRequest $request)
{
@ -330,12 +327,9 @@ class AuthController extends Controller
/**
* Login a customer
*
* @param \App\Models\Customers $customer
* @param boolean $remember
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Exception Exception.
* @throws \RuntimeException RuntimeException.
* @param Customers $customer
* @param boolean $remember
* @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
*/
private function processLogin(Customers $customer, bool $remember)
{
@ -364,12 +358,11 @@ class AuthController extends Controller
}
/**
* Fomulaire reset mot de passe sur la page login
* Fomulaire reset mot de passe
* sur la page login
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse|void
* @throws \Exception Exception.
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function passwordReset(Request $request)
{
@ -459,13 +452,12 @@ class AuthController extends Controller
}
/**
* Modification du mot de passe par lien via le formulaire reset mot de passe
* Modification du mot de passe par lien via le formulaire
* reset mot de passe
*
* @param \App\Http\Requests\ResetCustomerPassword $request
* @param string $token
* @param ResetCustomerPassword $request
* @param string $token
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \LDC\LDCCRM\Exceptions\CrmException CrmException.
*/
public function changePassword(ResetCustomerPassword $request, string $token)
{
@ -511,9 +503,8 @@ class AuthController extends Controller
/**
* Mettre à jour le mot de passe lorsque l'on est connecté
*
* @param \App\Http\Requests\CustomerUpdatePassword $request
* @param CustomerUpdatePassword $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function changePasswordWhenAuthenticated(CustomerUpdatePassword $request)
{

View file

@ -444,7 +444,6 @@ class MomentsController extends Controller
/**
* Passe un moment en moment star. Si il y avait déjà un moment star, il ne l'est plus et le nouveau le remplace
*
* @param id L'id du moment qui doit devenir moment star
*/
public function setStar($id)

View file

@ -406,7 +406,6 @@ class BoutiqueController extends Controller
/**
* Get Mercanet ref and responseCode for request
*
* @return array['ref' => 'value', 'responseCode' => 'value']
*/
private function getMercanetData(Request $request): array

View file

@ -42,8 +42,8 @@ class BreedingPageController extends Controller
*/
public function list(BreedingPageType $pageType)
{
$pages = BreedingPage::where('type', $pageType)->whereStatus(true)->get();
$bannerUrl = $this->getBannerUrlFromGeneralConfig($pageType);
$pages = BreedingPage::where('type', $pageType)->whereStatus(true)->get();
$bannerUrl = $this->getBannerUrlFromGeneralConfig($pageType);
$headerText = $this->getTextHeaderFromGeneralConfig($pageType);
return view('front.breeding-page.list', compact('pages', 'pageType', 'bannerUrl', 'headerText'));

View file

@ -51,11 +51,10 @@ class ClubController extends Controller
}
/**
* Index
* index
*
* @param \App\Enums\ArticleCategory|null $tag
* @param ArticleCategory|null $tag
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function index(ArticleCategory $tag = null)
{
@ -111,10 +110,8 @@ class ClubController extends Controller
*
* nom, prénom, adresse, code postal, ville
*
* @param \App\Http\Requests\UpdateInfosRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Illuminate\Validation\ValidationException ValidationException.
* @param UpdateInfosRequest $request
* @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
*/
public function updateInfos(UpdateInfosRequest $request)
{
@ -154,11 +151,8 @@ class ClubController extends Controller
/**
* missingCrmInfosSubmit
*
* @param \App\Http\Requests\UpdateInfosRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Illuminate\Validation\ValidationException ValidationException.
* @throws \Symfony\Component\Routing\Exception\RouteNotFoundException RouteNotFoundException.
* @param UpdateInfosRequest $request
* @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
*/
public function missingCrmInfosSubmit(UpdateInfosRequest $request)
{
@ -177,11 +171,9 @@ class ClubController extends Controller
/**
* Updates user info
*
* @param \App\Http\Requests\UpdateInfosRequest $request
* @return \Illuminate\Http\RedirectResponse|string|boolean return strictly true if success,
* false il failed, could be a string with message error if failed
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Illuminate\Validation\ValidationException ValidationException.
* @param UpdateInfosRequest $request
* @return boolean|string return strictly true if success,
* false il failed, could be a string with message error if failed
*/
private function updateUserInfo(UpdateInfosRequest $request)
{
@ -315,9 +307,9 @@ class ClubController extends Controller
/**
* reductionsGet
*
* @param \App\Http\Requests\DownloadBRFileRequest $request
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
* @throws \Exception Exception.
* @param DownloadBRFileRequest $request
* @return Response
* @throws Exception Exception.
*/
public function reductionsGet(DownloadBRFileRequest $request)
{
@ -355,11 +347,9 @@ class ClubController extends Controller
/**
* Call the article page with a slug for the article to print
*
* @param \App\Enums\ArticleCategory $tag
* @param \App\Models\Articles $publishedArticle
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @param ArticleCategory $tag
* @param Articles $publishedArticle
* @return View The view that the article have to print
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
*/
public function article(ArticleCategory $tag, Articles $publishedArticle)
@ -392,11 +382,8 @@ class ClubController extends Controller
/**
* Handle the request of a customer that answered a survey
*
* @param \App\Http\Requests\SurveyAnswersRequest $request
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \InvalidArgumentException InvalidArgumentException.
* @param SurveyAnswersRequest $request
* @return View View to go to
*/
public function answerSurvey(SurveyAnswersRequest $request)
{
@ -449,10 +436,8 @@ class ClubController extends Controller
/**
* Send a message to a user
*
* @param \App\Http\Requests\SendMessageRequest $request
* @param SendMessageRequest $request
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @throws \Throwable Throwable.
*/
public function sendMessage(SendMessageRequest $request)
{
@ -500,11 +485,8 @@ class ClubController extends Controller
/**
* Destroy a message
*
* @param \App\Http\Requests\DeleteMessagesRequest $request
* @param DeleteMessagesRequest $request
* @return \Illuminate\Http\JsonResponse
* @throws \LogicException LogicException.
* @throws \Throwable Throwable.
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function deleteMessage(DeleteMessagesRequest $request)
{
@ -538,10 +520,9 @@ class ClubController extends Controller
/**
* Block a customer to prevent him sending messages
*
* @param \App\Http\Requests\BlockCustomerRequest $request
* @param boolean $status
* @param BlockCustomerRequest $request
* @param boolean $status
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function blockCustomer(BlockCustomerRequest $request, bool $status)
{

View file

@ -102,7 +102,6 @@ class ContactController extends Controller
/**
* Propose meal recipe
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/

View file

@ -94,10 +94,9 @@ class CustomerController extends Controller
/**
* setFavoriteRecipe
*
* @param \App\Models\Recipes $recipe
* @param boolean $status
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @param Recipes $recipe
* @param boolean $status
* @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory
*/
public function setFavoriteRecipe(Recipes $recipe, bool $status)
{

View file

@ -1,99 +0,0 @@
<?php
namespace App\Http\Controllers\Fo;
use App\Http\Controllers\Controller;
use App\Models\OpInsta\InstaMedia;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\ValidationException;
use Illuminate\View\View;
class OpInstaController extends Controller
{
/**
* Show OpInsta page
*
* @return \Illuminate\View\View
*/
public function index(): View
{
$this->assertConfigIsValid();
$has_started = $this->hasStarted();
$instaMediaList = InstaMedia::query()->orderBy('id')->get()
->map(function (InstaMedia $media) {
$path = \explode('/', \rtrim(\parse_url(
$media->permalink,
\PHP_URL_PATH
), '/'));
$media->pictures = $this->fetchPicture(\collect($path)->last());
return $media;
});
return \view('front.opinsta.index', \compact('instaMediaList', 'has_started'));
}
/**
* Assert config is valid
*
* @return void
* @throws \ErrorException If config is invalid.
*/
private function assertConfigIsValid(): void
{
try {
$start = config('opinsta.start');
$end = config('opinsta.end');
Validator::validate([
'start' => $start,
'end' => $end,
], [
'start' => 'date_format:d-m-Y|before:end',
'end' => 'date_format:d-m-Y|after:start',
]);
} catch (ValidationException $e) {
$message = \collect($e->errors())->map(function ($el) {
return \collect($el)->implode(', ');
})->implode(', ');
throw new \ErrorException("Op install config is invalid, {$message}");
}
}
/**
* Le jeu a démaré ?
*
* Démarre à la date de départ (0h00) et s'arrête à la date de fin (23h59)
*
* @return boolean
*/
private function hasStarted(): bool
{
$start = Carbon::createFromFormat('d-m-Y', config('opinsta.start'), 'Europe/Paris')->setTime(0, 0);
$end = Carbon::createFromFormat('d-m-Y', config('opinsta.end'), 'Europe/Paris')->setTime(0, 0);
$now = Carbon::now('Europe/Paris')->setTime(0, 0);
return $now->isBetween($start, $end);
}
/**
* Fetch Media Picture Object
*
* @param string $ig_media_hash
* @return array<integer,string[]>
*/
private function fetchPicture(string $ig_media_hash): array
{
return Cache::remember(
"media_picture_ajax_fetch{$ig_media_hash}",
// * 3H cache
3 * 60 * 60,
function () use ($ig_media_hash) {
return InstaMedia::fetchInstagramMediaPictures($ig_media_hash);
}
);
}
}

View file

@ -52,11 +52,8 @@ class HomeController extends Controller
/**
* Call the CRM to add a single optin
*
* @param \App\Http\Requests\SingleOptinRequest $request
* @return string|array|null|\Illuminate\Contracts\Translation\Translator
* @throws \LDC\LDCCRM\Exceptions\ValidationException ValidationException.
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @param SingleOptinRequest $request
* @return string Message to print to the customer
*/
public function addOptIn(SingleOptinRequest $request)
{

View file

@ -77,4 +77,17 @@ class OCBController extends Controller
->inRandomOrder()->first();
return view('front.ocb.poultry', compact('breeder', 'ocbContents'));
}
/**
* Show ocb egg content
*
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/
public function egg()
{
$ocbContents = OCBContent::where('type', OCBType::egg())
->orderBy('order')
->where('status', true)->get();
return view('front.ocb.egg', compact('ocbContents'));
}
}

View file

@ -23,9 +23,8 @@ class EnterCodeController extends Controller
/**
* Participate Method
*
* @param \App\Http\Requests\OpBrCharcut\ParticipateRequest $request
* @param ParticipateRequest $request
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
public function participate(ParticipateRequest $request)
{
@ -33,11 +32,12 @@ class EnterCodeController extends Controller
}
/**
* Détermine si un BR doit être servi, renvoi la vue de gain BR
* Détermine si un BR doit être servi
* renvoi la vue de gain BR
*
* @param mixed $code
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @param
*
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/
private function serveCouponWin($code)
{
@ -68,9 +68,7 @@ class EnterCodeController extends Controller
* Update a coupon
*
* @param mixed $id_coupon
* @param mixed $qtty
* @return mixed
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
* @return \App\Models\Reduction|null
*/
private function updateCoupon($id_coupon, $qtty)
{
@ -109,15 +107,6 @@ class EnterCodeController extends Controller
return $reduction;
}
/**
* updateCustomer
*
* @param mixed $hascode
* @param mixed $email
* @param mixed $country
* @return mixed
* @throws \Illuminate\Contracts\Container\BindingResolutionException BindingResolutionException.
*/
private function updateCustomer($hascode, $email, $country)
{
/** @var \App\Lib\MesBR */

View file

@ -3,38 +3,19 @@
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\View;
class SecureHeaders
{
/**
* Enumerate headers which you do not want in your application's responses.
* Great starting point would be to go check out @Scott_Helme's:
* https://securityheaders.com/
*
* @var array
*/
// Enumerate headers which you do not want in your application's responses.
// Great starting point would be to go check out @Scott_Helme's:
// https://securityheaders.com/
private $unwantedHeaderList = [
'X-Powered-By',
'Server',
];
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next)
public function handle($request, Closure $next)
{
View::share('nonce', $nonce = \uniqid());
// * For VueJS dev tool to execute
$jsDev = config('app.debug') ? "'unsafe-eval' 'unsafe-inline'" : "'nonce-{$nonce}' 'strict-dynamic'";
$reportUri = Route::has('cspReportUri') ?
\sprintf('report-uri %s', \parse_url(route('cspReportUri'), \PHP_URL_PATH)) : '';
$this->removeUnwantedHeaders($this->unwantedHeaderList);
$response = $next($request);
$response->headers->set('Referrer-Policy', 'no-referrer-when-downgrade');
@ -43,48 +24,19 @@ class SecureHeaders
$response->headers->set('X-Frame-Options', 'SAMEORIGIN');
$response->headers->set('Strict-Transport-Security', 'max-age=31536000; includeSubDomains;');
$cspPolicies = [
'frame-src ' . implode(" ", [
'\'self\'',
'https://www.youtube.com',
'https://vimeo.com/',
'https://player.vimeo.com/',
'https://www.google.com/recaptcha/',
'https://recaptcha.google.com/recaptcha/'
]) . ';',
"style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://fonts.googleapis.com;",
// phpcs:ignore Generic.Files.LineLength.TooLong
'script-src ' . implode(" ", [
'\'self\'',
'\'unsafe-inline\'',
'\'unsafe-eval\'',
'https://cdnjs.cloudflare.com',
'https://*.googletagmanager.com',
'https://www.google-analytics.com',
'https://maps.googleapis.com',
'https://fonts.googleapis.com',
'https://www.google.com/recaptcha/',
'https://www.gstatic.com/recaptcha/',
'https://yl.s-web.fr',
]) . ' ' . $jsDev . ';'
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com https://www.googletagmanager.com https://www.google-analytics.com https://maps.googleapis.com https://fonts.googleapis.com;"
];
$response->headers->set(
'Content-Security-Policy',
implode(' ', $cspPolicies) . $reportUri
implode(' ', $cspPolicies)
);
$response->headers->set('Feature-Policy', \implode(',', [
'fullscreen', 'accelerometer', 'encrypted-media',
'gyroscope', 'picture-in-picture'
]) . ';');
$response->headers->set('Feature-Policy', 'fullscreen \'self\';');
return $response;
}
/**
* Remove unwanted headers
*
* @param array $headerList
* @return void
*/
private function removeUnwantedHeaders(array $headerList)
private function removeUnwantedHeaders($headerList)
{
foreach ($headerList as $header) {
header_remove($header);

View file

@ -67,7 +67,7 @@ class BoutiqueBuyRequest extends FormRequest
{
return [
'coords' => trans('vos coordonnées'),
'coords.civility' => trans('civilité dans vos coordonnées'),
'coords.civility' => trans('civilitée dans vos coordonnées'),
'coords.firstname' => trans('prénom dans vos coordonnées'),
'coords.lastname' => trans('nom dans vos coordonnées'),
'coords.address' => trans('adresse dans vos coordonnées'),
@ -76,7 +76,7 @@ class BoutiqueBuyRequest extends FormRequest
'coords.city' => trans('ville dans vos coordonnées'),
'coords.email' => trans('e-mail dans vos coordonnées'),
'shipping' => trans('votre adresse de livraison'),
'shipping.civility' => trans('civilité dans votre adresse de livraison'),
'shipping.civility' => trans('civilitée dans votre adresse de livraison'),
'shipping.firstname' => trans('prénom dans votre adresse de livraison'),
'shipping.lastname' => trans('nom dans votre adresse de livraison'),
'shipping.address' => trans('adresse dans votre adresse de livraison'),

View file

@ -4,7 +4,6 @@ namespace App\Http\Requests;
use App\Enums\ContactFormCivility;
use App\Enums\ContactFormType;
use App\Lib\Helpers\ToolboxHelper;
use Illuminate\Foundation\Http\FormRequest;
use Kwaadpepper\Enum\Rules\EnumIsValidRule;
@ -27,8 +26,6 @@ class ContactFormRequest extends FormRequest
*/
public function rules()
{
ToolboxHelper::validateRecaptcha($this, \config('services.google.recaptcha.version'));
if ($this->type == ContactFormType::onepage()->value) {
app()->setLocale('nl');
}

View file

@ -2,7 +2,6 @@
namespace App\Http\Requests;
use App\Lib\Helpers\ToolboxHelper;
use Carbon\Carbon;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;
@ -37,8 +36,6 @@ class CustomerRegisterRequest extends FormRequest
*/
public function rules()
{
ToolboxHelper::validateRecaptcha($this, \config('services.google.recaptcha.version'));
return [
'email' => 'required|email:rfc,dns,spoof,filter|max:255|unique:customers,email',
'username' => 'required|string|min:1|max:255|unique:customers,username',
@ -81,22 +78,13 @@ class CustomerRegisterRequest extends FormRequest
];
}
/**
*
* @return array
*/
public function attributes()
{
return [
'postcode' => 'Code postal',
'username' => 'pseudo'
'postcode' => 'Code postal'
];
}
/**
*
* @return array
*/
public function messages()
{
return [

View file

@ -17,19 +17,13 @@ class UpdateEngagement extends FormRequest
*/
public function authorize()
{
return auth()->check();
}
/**
* Prepare the data for validation.
*
* @return void
*/
public function prepareForValidation()
{
$this->merge([
'status' => $this->status ? true : false
]);
if (auth()->check()) {
$this->merge([
'status' => $this->status === null ? 0 : 1
]);
return true;
}
return false;
}
/**
@ -40,8 +34,7 @@ class UpdateEngagement extends FormRequest
public function rules()
{
$rules = [
'title' => 'required|string|min:7',
'status' => 'required|boolean'
'title' => 'required|string|min:7'
];
if ($this->engagement->type == EngagementType::header()) {
$rules = array_merge($rules, [
@ -136,14 +129,9 @@ class UpdateEngagement extends FormRequest
}//end if
break;
case InputType::url()->value:
if ($iptName === "link") {
$ruleAtt = "sometimes";
} else {
$ruleAtt = "required";
}
$rules = array_merge($rules, [
"content.$i.content.$iptName.value" => [
$ruleAtt, 'url',
'required', 'url',
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
function ($attribute, $value, $fail) {
try {
@ -184,10 +172,10 @@ class UpdateEngagement extends FormRequest
"content.$i.content.$iptName.value" => 'boolean'
]);
break;
} //end switch
} //end foreach
} //end foreach
} //end if
}//end switch
}//end foreach
}//end foreach
}//end if
return $rules;
}
}

View file

@ -17,7 +17,6 @@ class SendArchadiaMail implements ShouldQueue
/**
* To be serialized by jobs system
*
* @var MailContactData
* */
private $data;

View file

@ -16,7 +16,6 @@ class SendNLMail implements ShouldQueue
/**
* To be serialized by jobs system
*
* @var MailContactData
* */
private $data;

View file

@ -28,7 +28,6 @@ class SendOrderToArchadia implements ShouldQueue
/**
* Create a new job instance.
*
* @param \App\Models\Order $order
* @return void
*/

View file

@ -17,7 +17,6 @@ class SendPasserelleMail implements ShouldQueue
/**
* To be serialized by jobs system
*
* @var MailContactData
* */
private $data;

View file

@ -469,6 +469,7 @@ class XmlIncoReader extends XmlJobs
* <TYP_PORTION><![CDATA[Approximatif]]></TYP_PORTION>
* extracted as "TYP_PORTION" => "Approximatif"
*
*
* @param \SimpleXMLElement|false $sxe
* @return array
*/
@ -483,18 +484,15 @@ class XmlIncoReader extends XmlJobs
if ($value->count()) {
$extraction = $this->extract($value);
if (
count($extraction)
&& array_key_exists("code", $extraction)
&& array_key_exists("libelle", $extraction)
) {
$val = strval($extraction['libelle']);
if(count($extraction)
&& array_key_exists("code",$extraction)
&& array_key_exists("libelle",$extraction)) {
$val = strval($extraction['libelle']);
$extract[$key] = strlen($val) ? $val : null;
continue;
}
$extract[$key][] = $extraction;
// $this->extract($value);
$extract[$key][] = $extraction; //$this->extract($value);
continue;
}
$value = strval($value);
@ -503,7 +501,7 @@ class XmlIncoReader extends XmlJobs
} else {
$extract[$key] = strlen($value) ? $value : null;
}
}//end foreach
}
return $extract;
}
}

View file

@ -127,7 +127,6 @@ abstract class XmlJobs extends XArcadiaFlux
} catch (InvalidXmlException $e) {
$message = $e->getMessage();
if (get_class($e) === QueryException::class) {
/** @var \Illuminate\Database\QueryException $e */
$message = implode(' ', $e->errorInfo);
}
$this->log(

View file

@ -63,13 +63,13 @@ class XmlTracaReader extends XmlJobs
XmlTraceability::class,
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
function (\SimpleXMLElement $xmlContent, array &$line) {
$abatage_date = \explode('.', $line['abatage_date']);
// * Inverser année et jours a cause du flux
$abatage_date = \explode('-', $line['abatage_date']);
// * Inverser année et jours a cause du flux de merde
$line['abatage_date'] = \sprintf(
'20%s/%s/%s',
'20%s-%s-%s',
$abatage_date[2],
$abatage_date[1],
$abatage_date[0]
substr($abatage_date[0], 2)
);
}
);

View file

@ -1,65 +0,0 @@
<?php
namespace App\Lib\Helpers;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Validator;
class ToolboxHelper
{
/**
* Validate recaptcha
*
* @param Request $request
* @param boolean $isV3
* @return void
*/
public static function validateRecaptcha(Request $request, bool $isV3 = true)
{
Validator::validate($request->all(), [
'g-recaptcha-response' => [
'required', 'string',
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed, Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
function ($attribute, $value, $fail) use ($isV3) {
try {
$response = Http::asForm()->post('https://www.google.com/recaptcha/api/siteverify', [
'secret' => config('services.google.recaptcha.private'),
'response' => \strval($value),
'remoteip' => app('clientIp')
]);
if ($e = $response->toException()) {
throw $e;
}
if ($isV3) {
if (
!$response->json('success') or
!$response->json('challenge_ts') or
Carbon::parse($response->json('challenge_ts'))->lessThan(\now('utc')->subMinutes(5)) or
$response->json('hostname') !== \parse_url(config('app.url'), \PHP_URL_HOST) or
!$response->json('score')
) {
throw new \RuntimeException();
}
if (\floatval($response->json('score')) < 0.8) {
$fail("Vous n'avez pas obtenu un score assez élevé lors de la validation du recaptcha");
}
return;
}
if (
!$response->json('success') or
!$response->json('challenge_ts') or
Carbon::parse($response->json('challenge_ts'))->lessThan(\now('utc')->subMinutes(5)) or
$response->json('hostname') !== \parse_url(config('app.url'), \PHP_URL_HOST)
) {
throw new \RuntimeException();
}
} catch (\Exception $e) {
$fail('Erreur lors de la validation du formulaire veuillez réssayer');
} //end try
}
]
], [], ['g-recaptcha-response' => 'reCaptcha']);
}
}

View file

@ -1,91 +0,0 @@
<?php
namespace App\Lib\Instagram;
use App\Exceptions\InstaApiLimitReachedException as InstaApiException;
use Illuminate\Http\Client\HttpClientException;
use Illuminate\Http\Client\Response;
use Illuminate\Support\Facades\Http;
/**
* Fetch Instagram Top Media List
*
* @package App\Lib
*/
class ApiFetcher
{
/**
* Try to fetch media pictures from a permalink using og data.
*
* @param string $url
* @return array
* @throws \RuntimeException If a call error or a response parsing error occurs.
*/
public function fetchMediaPicturesFromPostPermalink(string $url): array
{
try {
$response = $this->httpCall('GET', $url);
$html = $response->body();
$dom = new \DOMDocument();
$dom->loadHTML($html);
$scripts = $dom->getElementsByTagName('script');
return collect($scripts)->filter()->map(function (\DOMElement $script) {
if ($script->getAttribute('type') != 'application/ld+json') {
return null;
}
$entity = json_decode($script->nodeValue, true);
if ($entity['@type'] !== 'SocialMediaPosting') {
return null;
}
return \collect($entity['image'])->map(function (array $picture) {
return $picture['url'];
})->all();
})->filter(function ($el) {
return !empty($el);
})->first() ?? [];
} catch (\Exception $e) {
throw new \RuntimeException($e->getMessage(), $e->getCode(), $e);
} //end try
}
/**
* Call url and fetch result in array.
*
* @param string $method The HTTP VERB to use (GET, POST).
* @param string|\Psr\Http\Message\UriInterface $uri The uri to call.
* @param array $parameters The call parameters to pass on.
* @return \Illuminate\Http\Client\Response
* @throws \Error If the request method is not supported.
* @throws \RuntimeException If something goes wrong.
* @throws \App\Exceptions\InstaApiException If the api denies access for some reason.
*/
private function httpCall(
string $method,
$uri = '',
array $parameters = []
): Response {
try {
if (!\in_array(\strtoupper($method), ['GET', 'POST'])) {
throw new \Error("Unsupported method {$method}");
}
/** @var \Illuminate\Http\Client\Response */
$response = Http::timeout(\config('app.debug') ? 3 : 30)
->retry(2, 100)
->{strtolower($method)}($uri, $parameters);
// * Throw an exception if an error occured.
$response->throw();
return $response;
} catch (HttpClientException $e) {
/** @var \Illuminate\Http\Client\Response $response */
if ($e instanceof \Illuminate\Http\Client\RequestException and $e->getCode() === 403) {
$response = $e->response;
$message = $response->json('error.message');
$code = $response->json('error.code');
throw new InstaApiException($message, $code, $e);
}
throw new \RuntimeException($e);
} //end try
}
}

View file

@ -1,50 +0,0 @@
<?php
namespace App\Lib\Instagram\Objects;
use Illuminate\Support\Carbon;
/**
* Top Media object
*
* @property integer $insta_id A unique instagram id that can be used for api calls.
* @property string $type The instagram object type, commonly IMAGE or CAROUSEL_ALBUM.
* @property string $username The instagram user name, scrapped using OG description.
* @property string $caption The object text content.
* @property string $permalink The uri where is stored the Instagram object.
* @property \Carbon\Carbon $timestamp UTC timestamp from instagram api.
* @property integer $comments_count The number of comments.
* @property null|integer $like_count The number of likes.
*
* @package App\Lib\Instagram\Objects
*/
class TopMedia extends \stdClass
{
/**
* Set this object data from Ig api data
*
* @param object $ig_media
* @return void
*/
public function setData(object $ig_media): void
{
$this->insta_id = \intval($ig_media->id);
$this->type = $ig_media->media_type;
$this->permalink = $ig_media->permalink;
$this->timestamp = Carbon::parse($ig_media->timestamp);
$this->comments_count = \intval($ig_media->comments_count);
$this->like_count = \optional($ig_media)->like_count ? \intval($ig_media->like_count) : null;
$this->caption = $ig_media->caption;
}
/**
* Set this object username
*
* @param string $username
* @return void
*/
public function setUserName(string $username): void
{
$this->username = $username;
}
}

View file

@ -558,7 +558,6 @@ class Mercanet
/**
* Filter http request parameters
*
* @param array $requestParameters
*/
private function filterRequestParameters(array $httpRequest)
@ -596,7 +595,6 @@ class Mercanet
/**
* Checks if the response is valid
*
* @return boolean
*/
public function isValid()
@ -660,7 +658,6 @@ class Mercanet
/**
* Retrieves a response parameter
*
* @param string $param
* @throws \InvalidArgumentException
*/

View file

@ -5,7 +5,6 @@ namespace App\Lib;
class MesBR
{
private $endpoint;
private $refCamp;
public function __construct($endpoint, $refCamp)

View file

@ -9,23 +9,20 @@ namespace App\Lib;
class MesBROld
{
private $endpoint;
private $refSite;
private $refCamp;
public function __construct($endpoint, $refSite, $refCamp)
{
$this->endpoint = $endpoint;
$this->refSite = $refSite;
$this->refCamp = $refCamp;
$this->refSite = $refSite;
$this->refCamp = $refCamp;
}
/** Update contact *
* NOT USED - SHOULD BE DELETED
*
* @param $oCrmUser
* @return boolean
* @return bool
*/
public function updateContact($oCrmUser)
{
@ -49,10 +46,9 @@ class MesBROld
}
/** Update panier *
*
* @param $oCrmUser
* @param $couponId
* @param integer $quantity
* @param int $quantity
* @return array
*/
public function updatePanier($oCrmUser, $refid, $couponId, $quantity = 1)
@ -60,7 +56,7 @@ class MesBROld
$datas = [
'refsite' => $this->refSite,
'refcamp' => $this->refCamp,
// TODO : ici il faut une id qui est ajoutée au code barre du coupon donc un hascode c'est trop long
//TODO : ici il faut une id qui est ajoutée au code barre du coupon donc un hascode c'est trop long
'refadherent' => $refid,
'nom' => $oCrmUser->lastname,
'prenom' => $oCrmUser->firstname,
@ -70,7 +66,7 @@ class MesBROld
'pays' => $this->getCountry($oCrmUser->country),
'panier' => "($quantity)$couponId"
];
$res = $this->callAPI("GET", "/updatebasket", $datas);
$res = $this->callAPI("GET", "/updatebasket", $datas);
if (!$res) {
error_log("MESBR - CODE : 999 - MESSAGE : Cannot read API Response (non json)");
return ['status' => 'KO', 'code' => 999, 'message' => 'Cannot read API Response (non json)'];
@ -80,7 +76,7 @@ class MesBROld
return ['status' => 'KO', 'code' => $res->Code, 'message' => $res->Message];
}
$panierVerification = $this->endpoint . '/showbasket?basketid=' . $res->Panier->Panier;
$panier_link = $this->endpoint . '/?basketid=' . $res->Panier->Panier;
$panier_link = $this->endpoint . '/?basketid=' . $res->Panier->Panier;
return ['status' => 'OK', 'link' => $panier_link, 'verif' => $panierVerification, 'basketId' => $res->Panier->Panier];
}
/** Génère le lien vers le mur (ou panier préprogrammé) **/
@ -98,8 +94,7 @@ class MesBROld
return 442;
break;
default:
return 250;
// France
return 250; //France
break;
}
}
@ -109,23 +104,20 @@ class MesBROld
switch ($method) {
case "POST":
curl_setopt($curl, CURLOPT_POST, 1);
if ($data) {
if ($data)
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
break;
case "PUT":
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
if ($data) {
if ($data)
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
break;
default:
if ($data) {
if ($data)
$url = sprintf("%s?%s", $url, http_build_query($data));
}
}
curl_setopt($curl, CURLOPT_URL, $this->endpoint . $url);
curl_setopt($curl, CURLOPT_COOKIESESSION, true);
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
if (!$result) {

View file

@ -25,7 +25,6 @@ class Utils
* Replace stange accents
*
* https://stackoverflow.com/questions/3371697/replacing-accented-characters-php
*
* @author Jérémy Munsch <jeremy.munsch@jeremydev.ovh>
* @param string $subject
* @return string

View file

@ -51,7 +51,7 @@ class Order extends Mailable
protected function makePdfFile(): string
{
/** @var \Meneses\LaravelMpdf\LaravelMpdfWrapper */
$mpdf = app('laravel-mpdf');
$mpdf = app('mpdf.wrapper');
/** @var \Meneses\LaravelMpdf\LaravelMpdf */
$pdf = $mpdf->loadView(
'documents.order',

View file

@ -21,8 +21,8 @@ class ReductionWon extends Mailable implements ShouldQueue
*/
public function __construct($user, $linkpanier)
{
$this->user = $user;
$this->linkpanier = $linkpanier;
$this->user = $user;
$this->linkpanier = $linkpanier;
}
/**

View file

@ -126,7 +126,6 @@ class Contact extends Model
/**
* Get Counter skeleton
*
* @return array
*/
private function counterSkeleton(): array

View file

@ -4,6 +4,7 @@ namespace App\Models;
use App\Enums\DepartaimantCollectionType;
use App\Http\Resources\CustomerCrmResource;
use App\Lib\Utils;
use Illuminate\Support\Str;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

View file

@ -34,52 +34,22 @@ class DepartaimantsCollection extends Model
protected $table = 'departaimants';
private static $columnTableNamePrefix = 'col';
/**
* Le prefix d'un table departaimant
*
* @var integer
*/
// Le prefix d'un table departaimant
private static $tableFields = 4;
/**
* Le nombre de colonnes des departaimants
*
* @var integer
*/
// Le nombre de colonnes des departaimants
private static $departementWidth = 2;
/**
* La largeur en bits d'un départaimant
* * to be set in construct
*
* @var array
*/
// La largeur en bits d'un départaimant
public $attributes = [
'type' => 'current'
// to be set in construct
];
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
public $fillable = [
'collection'
];
/**
* Handle dynamic static method calls into the model.
*
* @param string $name
* @param array $arguments
* @return mixed
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
* @phpcs:disable Squiz.Commenting.FunctionComment.ScalarTypeHintMissing
*/
public static function __callStatic($name, $arguments)
{
// phpcs:enable
if ($name === 'defaultType') {
return DepartaimantCollectionType::current();
}
@ -89,8 +59,8 @@ class DepartaimantsCollection extends Model
/**
* @param array $attributes
* @throws \TypeError
* @throws \BadMethodCallException
* @throws TypeError
* @throws BadMethodCallException
*/
public function __construct(array $attributes = [])
{

View file

@ -11,25 +11,16 @@ use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Kwaadpepper\Enum\Traits\CastsEnums;
// old Breeders
class OCBBreeder extends BreederForGmap
{
use CastsEnums;
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'display' => 'boolean',
'inuavs' => 'array'
];
/**
* The attributes that should be cast to Enums.
*
* @var array
*/
protected $enumCasts = [
'presentation_type' => PresentationType::class,
'ocbStatus' => EleveurOcbStatus::class,
@ -37,18 +28,8 @@ class OCBBreeder extends BreederForGmap
'geo_type' => GeoType::class
];
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'ocb_breeders';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'breeder_code',
'first_name',
@ -70,11 +51,6 @@ class OCBBreeder extends BreederForGmap
'inuavs',
];
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted()
{
static::creating(function ($breeder) {
@ -120,18 +96,11 @@ class OCBBreeder extends BreederForGmap
});
}
/**
* Get the route key for the model.
*
* @return string
*/
public function getRouteKeyName()
{
return "slug";
}
// * METHODS
/**
* Get ocb validated breeders query
*
@ -142,55 +111,28 @@ class OCBBreeder extends BreederForGmap
return static::where('ocbStatus', EleveurOcbStatus::yes());
}
/**
* Getter picture attribute
*
* @return mixed
*/
protected function getPictureAttribute()
{
return $this->pictureAttribute('picture');
}
/**
* Getter picture_1 attribute
*
* @return mixed
*/
protected function getPicture1Attribute()
{
return $this->pictureAttribute('picture1');
}
/**
* Getter picture_2 attribute
*
* @return mixed
*/
protected function getPicture2Attribute()
{
return $this->pictureAttribute('picture2');
}
/**
* Getter picture_3 attribute
*
* @return mixed
*/
protected function getPicture3Attribute()
{
return $this->pictureAttribute('picture3');
}
/**
* Refactored picture attribute
*
* @param string $prop
* @return mixed
*/
private function pictureAttribute(string $prop)
{
$p = $this->attributes[$prop];
// For migrated urls from 2016.
// For migrated urls from 2016
if (
is_null($p) or
!strlen($p) or

View file

@ -10,27 +10,12 @@ class OCBContent extends Model
{
use CastsEnums;
/**
* The attributes that should be cast to Enums.
*
* @var array
*/
protected $enumCasts = [
'type' => OCBType::class
];
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'ocb_content';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'picture',
'content',
@ -39,11 +24,6 @@ class OCBContent extends Model
'status'
];
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted()
{
static::creating(function ($ocbContent) {

View file

@ -11,7 +11,6 @@ use Kwaadpepper\Serial\Exceptions\SerialCasterException;
class Code extends Model
{
protected $table = 'opbrcharcut_codes';
/**
* The attributes that are mass assignable.
*
@ -30,6 +29,7 @@ class Code extends Model
public $timestamps = false;
// * RELATIONS
public function customer()
{
return $this->belongsTo(Customers::class);
@ -83,7 +83,7 @@ class Code extends Model
);
} catch (SerialCasterException $e) {
Log::error($e->getMessage() . " code utilisé : " . $serial);
// return 0 invalid value for code
//return 0 invalid value for code
return 0;
}
}

View file

@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class CodeEan extends Model
{
protected $table = 'opbrcharcut_codes_eans';
/**
* The attributes that are mass assignable.
*

View file

@ -1,91 +0,0 @@
<?php
namespace App\Models\OpInsta;
use Illuminate\Database\Eloquent\Casts\AsStringable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* @mixin \App\Lib\Instagram\Objects\TopMedia
*
* @package App\Models\OpInsta
*/
class InstaMedia extends Model
{
use HasFactory;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'opinsta';
/**
* The attributes that should be cast.
*
* @var string[]
*/
protected $casts = [
'caption' => AsStringable::class,
'permalink' => AsStringable::class,
'timestamp' => 'immutable_datetime'
];
// * METHODS
/**
* Fetch Media picture using ig media hash
*
* @param string $ig_media_hash
* @return array
* @throws \RuntimeException If a call error or a response parsing error occurs.
*/
public static function fetchInstagramMediaPictures(string $ig_media_hash): array
{
/** @var \App\Lib\Instagram\ApiFetcher */
$igFetcherClient = \app('Instagram');
return $igFetcherClient->fetchMediaPicturesFromPostPermalink("https://www.instagram.com/p/{$ig_media_hash}/");
}
/**
* Fetch and check config elements
*
* @return array 'hashtag_id', 'user_id', 'media_count', 'fields'
* @throws \RuntimeException If config is not valid.
*/
private static function fetchConfigParameters(): array
{
$hashtag_id = config('services.facebook.enpoints.ig_top_media.hashtag_id');
$user_id = config('services.facebook.enpoints.ig_top_media.user_id');
$media_count = config('services.facebook.enpoints.ig_top_media.media_count');
if (empty($hashtag_id)) {
throw new \RuntimeException(
'Missing services.facebook.enpoints.ig_top_media.hashtag_id,
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_HASHTAGID'
);
}
if (empty($user_id)) {
throw new \RuntimeException(
'Missing services.facebook.enpoints.ig_top_media.user_id,
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_USERID'
);
}
if (empty($media_count)) {
throw new \RuntimeException(
'Missing services.facebook.enpoints.ig_top_media.media_count,
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_NBMEDIA'
);
}
$hashtag_id = \intval($hashtag_id);
$user_id = \intval($user_id);
$media_count = \intval($media_count);
return \compact(
'hashtag_id',
'user_id',
'media_count'
);
}
}

View file

@ -70,7 +70,6 @@ class Recipes extends Model
/**
* Get Associated Recipes
*
* @return \Illuminate\Database\Eloquent\Collection<Recipes>
*/
public function associatedRecipes()
@ -138,7 +137,6 @@ class Recipes extends Model
/**
* Check if recipe has been rated by the user (in session also if not Auth)
*
* @return boolean
*/
public function hasBeenRatedByUser()
@ -154,7 +152,6 @@ class Recipes extends Model
/**
* Check if recipe has been rated by the user (in session also if not Auth)
*
* @return boolean
*/
public function getUserRating()
@ -170,7 +167,6 @@ class Recipes extends Model
/**
* Set the recipes rating and memorize in session, or user
*
* @param string $rating
* @return void
*/

View file

@ -2,7 +2,6 @@
namespace App\Providers;
use App\Lib\Instagram\ApiFetcher;
use App\Models\Actu;
use App\Models\Articles;
use App\Models\GeneralConfig;
@ -83,11 +82,6 @@ class AppServiceProvider extends ServiceProvider
Log::critical($e->getMessage());
View::share('GeneralConfigGlobal', []);
}
// * Instagram Singleton
App::singleton('Instagram', function () {
return new ApiFetcher();
});
}//end if
Blade::directive('svg', function ($arguments) {

View file

@ -207,10 +207,7 @@ class RouteServiceProvider extends ServiceProvider
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web-bo.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web-fo.php'));
->group(base_path('routes/web.php'));
}
/**

View file

@ -27,6 +27,9 @@ trait GoogleMapSerialize
case OCBType::poultry()->value:
$ocbType = trans('Éleveur de volaille');
break;
case OCBType::egg()->value:
$ocbType = trans('Producteur d\'oeufs');
break;
case OCBType::rabbit()->value:
$ocbType = trans('Éleveur de lapins');
break;

View file

@ -18,10 +18,11 @@
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.4",
"htmlmin/htmlmin": "^8.0",
"kwaadpepper/enum": "^2.1",
"kwaadpepper/image-resizer": "^0.1.0",
"kwaadpepper/refresh-sitemap": "1.0.0",
"kwaadpepper/serial-int-caster": "1.0.1",
"kwaadpepper/refresh-sitemap": "^1.0",
"kwaadpepper/serial-int-caster": "^1.0",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^3.0",
@ -46,9 +47,9 @@
"slevomat/coding-standard": "^7.0"
},
"repositories": {
"lab.s-web.fr/23": {
"gitlab.com/16669037": {
"type": "composer",
"url": "https://lab.s-web.fr/api/v4/group/23/-/packages/composer/packages.json"
"url": "https://gitlab.com/api/v4/group/16669037/-/packages/composer/packages.json"
}
},
"config": {
@ -56,12 +57,8 @@
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"php-http/discovery": true
},
"gitlab-domains": [
"lab.s-web.fr"
]
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"extra": {
"laravel": {

994
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -148,7 +148,6 @@ return [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
@ -175,11 +174,11 @@ return [
/*
* Package Service Providers...
*/
HTMLMin\HTMLMin\HTMLMinServiceProvider::class,
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,

View file

@ -82,26 +82,6 @@ return [
]) : [],
],
'opinsta' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL_OPINSTA'),
'host' => env('DB_HOST_OPINSTA', '127.0.0.1'),
'port' => env('DB_PORT_OPINSTA', '3306'),
'database' => env('DB_DATABASE_OPINSTA', 'forge'),
'username' => env('DB_USERNAME_OPINSTA', 'forge'),
'password' => env('DB_PASSWORD_OPINSTA', ''),
'unix_socket' => env('DB_SOCKET_OPINSTA', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA_2016'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),

70
config/htmlmin.php Normal file
View file

@ -0,0 +1,70 @@
<?php
/*
* This file is part of Laravel HTMLMin.
*
* (c) Graham Campbell <graham@alt-three.com>
* (c) Raza Mehdi <srmk@outlook.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
/*
|--------------------------------------------------------------------------
| Automatic Blade Optimizations
|--------------------------------------------------------------------------
|
| This option enables minification of the blade views as they are
| compiled. These optimizations have little impact on php processing time
| as the optimizations are only applied once and are cached. This package
| will do nothing by default to allow it to be used without minifying
| pages automatically.
|
| Default: false
|
*/
'blade' => env('APP_DEBUG') ? false : 'html',
/*
|--------------------------------------------------------------------------
| Force Blade Optimizations
|--------------------------------------------------------------------------
|
| This option forces blade minification on views where there such
| minification may be dangerous. This should only be used if you are fully
| aware of the potential issues this may cause. Obviously, this setting is
| dependent on blade minification actually being enabled.
|
| PLEASE USE WITH CAUTION
|
| Default: false
|
*/
'force' => false,
/*
|--------------------------------------------------------------------------
| Ignore Blade Files
|--------------------------------------------------------------------------
|
| Here you can specify paths, which you don't want to minify.
|
*/
'ignore' => [
'resources/views/emails',
'resources/views/html',
'resources/views/notifications',
'resources/views/markdown',
'resources/views/vendor/emails',
'resources/views/vendor/html',
'resources/views/vendor/notifications',
'resources/views/vendor/markdown',
],
];

View file

@ -11,7 +11,7 @@ return [
'paginate' => env('CODE_PAGINATE', 65530),
// Dictionnary of chars to use fo generating unique codes.
'codeCharList' => 'ABCDEFGHJKMNPRSTUWXYZ123456789',
'codeCharList' => 'ABCDEFGHJKMNPQRSTUWXYZ123456789',
// Code length.
'codeLength' => 9
];

View file

@ -1,6 +0,0 @@
<?php
return [
'start' => env('OPINSTA_START'),
'end' => env('OPINSTA_END')
];

View file

@ -38,8 +38,7 @@ return [
'publishedProduct' => [Products::class, 'slug']
],
'products.range' => [
'slugRange' => [Range::class, 'slug'],
'slugSubRange' => [Range::class, 'slug'],
'slugRange' => [Range::class, 'slug']
],
'products.consumption-times' => [
'slugConsumptionTime' => [ConsumptionTimes::class, 'slug']
@ -86,7 +85,7 @@ return [
*/
'queryConditions' => [
'status' => true,
'ocbStatus' => strval(EleveurOcbStatus::yes()->value),
'ocbStatus' => EleveurOcbStatus::yes()->value,
'star_moment' => true
],

View file

@ -30,16 +30,4 @@ return [
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'google' => [
'recaptcha' => [
'public' => env('GOOGLE_RECAPTCHA_PUBLIC'),
'private' => env('GOOGLE_RECAPTCHA_PRIVATE'),
'version' => env('GOOGLE_RECAPTCHA_VERSION', "3") === "3" ? true : false
]
],
'matomo' => [
'site_id' => env('MATOMO_SITE_ID')
],
];

View file

@ -269,6 +269,8 @@ class MigrateOldDataBase extends LeGaulois2016Migration
case 'lapin':
$model->ocbType = OCBType::rabbit();
break;
case 'oeuf':
$model->ocbType = OCBType::egg();
}
} catch (Exception $e) {
$model->ocbType = OCBType::poultry();
@ -406,6 +408,8 @@ class MigrateOldDataBase extends LeGaulois2016Migration
return OCBType::poultry();
case 'LAPIN':
return OCBType::rabbit();
case 'OEUF':
return OCBType::egg();
}
},
'name' => 'ocb_type',

View file

@ -84,6 +84,8 @@ class RemigrateOcbBreeders extends LeGaulois2016Migration
case 'lapin':
$model->ocbType = OCBType::rabbit();
break;
case 'oeuf':
$model->ocbType = OCBType::egg();
}
} catch (Exception $e) {
$model->ocbType = OCBType::poultry();

View file

@ -78,6 +78,8 @@ class RemigrateOcbBreeders2 extends LeGaulois2016Migration
case 'lapin':
$model->ocbType = OCBType::rabbit();
break;
case 'oeuf':
$model->ocbType = OCBType::egg();
}
} catch (Exception $e) {
$model->ocbType = OCBType::poultry();

View file

@ -1,30 +0,0 @@
<?php
use App\Models\OCBBreeder;
use App\Models\OCBContent;
use Illuminate\Database\Migrations\Migration;
class RemoveOcbEgg extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// * 0 OCB type EGG.
OCBContent::query()->where('type', 0)->delete();
OCBBreeder::query()->where('ocbType', 0)->delete();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// * Wont undo this.
}
}

Some files were not shown because too many files have changed in this diff Show more