Mise en place de Laravel 11 avec Fortify

This commit is contained in:
hugol
2024-11-12 18:19:10 +01:00
parent 999d5524d1
commit a21b69bd8f
212 changed files with 4837 additions and 52217 deletions

View File

@@ -1,10 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AccountController extends Controller
{
//
}

View File

@@ -1,10 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class BotController extends Controller
{
//
}

View File

@@ -1,644 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Symfony\Component\BrowserKit\HttpBrowser;
use Symfony\Component\HttpClient\HttpClient;
class ContestController extends Controller
{
public function twitterlist()
{
$client = new HttpBrowser(HttpClient::create(['verify_peer' => false, 'verify_host' => false, 'timeout' => '60']));
// Création des informations d'authentification
$username = 'autokdo';
$password = '@Gaudin95';
$credentials = base64_encode("$username:$password");
// Ajout des informations d'authentification à l'en-tête de la demande HTTP
$client->setServerParameter('HTTP_AUTHORIZATION', 'Basic ' . $credentials);
$client->setServerParameter('HTTP_USER_AGENT', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36');
$crawler = $client->request('GET', 'https://nitter.lucabased.xyz/i/lists/1686126753205387264');
$i = 1;
while ($i < 10){
$results = $crawler->filterXPath('//div[@class="timeline-item "]')->each(function ($node) {
$id = ($node->filterXPath('//*[@class="tweet-link"]'))->attr('href');
$created_at = ($node->filterXPath('//span[@class="tweet-date"]/a'))->attr('title');
$text = ($node->filterXPath('//*[@class="tweet-content media-body"]'))->text();
$screen = ($node->filterXPath('//a[@class="username"]'))->text();
$picture = ($node->filterXPath('//a[@class="still-image"]'))->attr('href');
$nbretweet = ($node->filterXPath('//*[@class="tweet-stat"][2]'))->text();
$nbretweet = str_replace(',', '', $nbretweet);
$nblike = ($node->filterXPath('//*[@class="tweet-stat"][4]'))->text();
$nblike = str_replace(',', '', $nblike);
$nbreply = ($node->filterXPath('//*[@class="tweet-stat"][1]'))->text();
$nbreply = str_replace(',', '', $nbreply);
//Modifications
$picture = urldecode($picture);
$picture = str_replace('/pic/orig/', 'https://pbs.twimg.com/', $picture);
$screen = str_replace('@', '', $screen);
$id = str_replace('/'.$screen.'/status/', '', $id);
$id = str_replace('#m', '', $id);
$contest = Contest::where('tweetid', $id)->first();
if(empty($contest) && $nbretweet > 100) {
$regex_detect_rts =
[
"/\bRT\b/",
"/RETWEET/i",
"/REPUBL/i",
"/REPOST/i",
];
foreach ($regex_detect_rts as $regex_detect_rt) {
//if (strstr($string, $url)) { // mine version
preg_match($regex_detect_rt, $text, $invites);
if (isset($invites[0])) {
$rt = true;
}
}
//On verifie que si RT
if (isset($rt)) {
$inputs = array();
//On recherche la date de fin du concours
$date = $this->getDate($text);
if ($date != null) {
$fin = $date;
} else {
$fin = $this->getTwitterDate($created_at);
}
//On recherche la date de fin du concours
if ($fin >= Carbon::now()->format('Y-m-d')) {
$categorie = $this->getCategorie($text);
$organizer = $this->getOrganizer($screen);
$concours = Contest::create([
'category_id' => $categorie,
'organizer_id' => $organizer,
'description' => $text,
'url' => 'https://twitter.com/'.$screen.'/status/'.$id,
'tweetid' => $id,
'fin' => $fin,
'nbretweet' => $nbretweet,
'nblike' => $nblike,
'nbreply' => $nbreply,
]);
//On recherche un tag
$regex_detect_tags =
[
"/INVIT/i",
"/IDENTIFI/i",
"/TAG/i",
"/HASHTAG/i",
"/RT AVEC/i",
"/MENTIONN/i",
"/COMMENT/i",
"/RETWEET AVEC/i",
"/TWEET AVEC/i",
];
foreach ($regex_detect_tags as $regex_detect_tag) {
//if (strstr($string, $url)) { // mine version
preg_match($regex_detect_tag, $text, $invites);
if (isset($invites[0])) {
$tweet = true;
}
}
//On verifie s'il demande un tag ou un hashtag
if (isset($tweet)) {
$tag = 'Je veux gagner ce concours @ActuFoot_ @Mediavenir';
preg_match_all("/#[a-zA-Z0-9]+/", $text, $hashtag);
if (isset($hashtag[0])) {
$hashtags = implode(" ", $hashtag[0]);
$tag = $tag . ' ' . $hashtags;
}
$tag = urlencode($tag);
//On tweet avec un le tag
Action::create([
'contest_id' => $concours->id,
'type' => 'reply',
'value' => $tag,
]);
//On follow les autres
preg_match_all("/\s@([\w_-]+)/", $text, $matches);
$mentions = $matches[1];
$mentions[] = $screen;
$mentions = array_unique($mentions);
foreach ($mentions as $mention) {
Action::create([
'contest_id' => $concours->id,
'type' => 'follow',
'value' => $mention,
]);
}
//On like si besoin
preg_match("/LIKE/i", $text, $like);
if (isset($like[0])) {
Action::create([
'contest_id' => $concours->id,
'type' => 'like',
'value' => $id,
]);
}
} //Sinon on retweet tout simplement
else {
//On follow les autres
preg_match_all("/\s@([\w_-]+)/", $text, $matches);
$mentions = $matches[1];
$mentions[] = $screen;
$mentions = array_unique($mentions);
foreach ($mentions as $mention) {
Action::create([
'contest_id' => $concours->id,
'type' => 'follow',
'value' => $mention,
]);
}
//On like si besoin
preg_match("/LIKE/i", $text, $like);
if (isset($like[0])) {
Action::create([
'contest_id' => $concours->id,
'type' => 'like',
'value' => $id,
]);
}
}
}
}
}
});
$nextPageButton = $crawler->filterXPath('//div[@class="show-more"]/a')->link();
$url = $nextPageButton->getUri();
$crawler = $client->request('GET', $url);
$i++;
}
$reponse = $client->getResponse();
var_dump($reponse);
Cache::flush();
echo 'Fait !';
}
public function searchcontest()
{
$search = [
"#concours",
"concours like",
"concours rt",
"concours follow",
"#JeuConcours",
"JeuConcours",
"giveaway",
"concours pour gagner",
"gagner rt",
"Gagnez rt + follow",
"offre follow gagnant",
"RT & follow",
"rt follow",
//"rt suivre t.a.s",
"concours tas le",
"concours résultats le rt",
"concours rt like",
"concours rt fav",
"RT tweet Follow",
"concours rt follow",
"rt follow tas",
"rt follow tirage au sort",
//"rt follow t.a.s",
"rt follow gagner",
"rt follow commente",
"rt suivre concours",
"rt suivez concours",
"rt suivre tirage au sort",
"rt suivre tas",
"concours remporter",
"remporter rt",
//"concours t.a.s le",
"tirage au sort concours",
"concours",
"concours résultat le rt"
];
$k = array_rand($search);
$phrase = $search[$k];
$date = Carbon::now()->subDays(2)->format('Y-m-d');
$url = 'https://nitter-autokdo.fly.dev/search?f=tweets&q='.urlencode('min_replies:500 lang:fr -filter:replies '.$phrase).'&since='.$date;
$client = new HttpBrowser(HttpClient::create(['verify_peer' => false, 'verify_host' => false, 'timeout' => '60']));
// Création des informations d'authentification
$username = 'autokdo';
$password = '@Gaudin95';
$credentials = base64_encode("$username:$password");
// Ajout des informations d'authentification à l'en-tête de la demande HTTP
$client->setServerParameter('HTTP_AUTHORIZATION', 'Basic ' . $credentials);
$client->setServerParameter('HTTP_USER_AGENT', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36');
$crawler = $client->request('GET', $url);
$reponse = $client->getResponse();
var_dump($reponse);
try{
$results = $crawler->filterXPath('//div[@class="timeline-item "]')->each(function ($node) {
$id = ($node->filterXPath('//*[@class="tweet-link"]'))->attr('href');
$created_at = ($node->filterXPath('//span[@class="tweet-date"]/a'))->attr('title');
$text = ($node->filterXPath('//*[@class="tweet-content media-body"]'))->text();
$screen = ($node->filterXPath('//a[@class="username"]'))->text();
$nbretweet = ($node->filterXPath('//*[@class="tweet-stat"][2]'))->text();
$nbretweet = str_replace(',', '', $nbretweet);
$nblike = ($node->filterXPath('//*[@class="tweet-stat"][4]'))->text();
$nblike = str_replace(',', '', $nblike);
$nbreply = ($node->filterXPath('//*[@class="tweet-stat"][1]'))->text();
$nbreply = str_replace(',', '', $nbreply);
//Modifications
$screen = str_replace('@', '', $screen);
$id = str_replace('/'.$screen.'/status/', '', $id);
$id = str_replace('#m', '', $id);
$contest = Contest::where('tweetid', $id)->first();
$fake = Fake::where('screen_name', $screen)->first();
if(!$contest && !$fake && $nbretweet > 100) {
$regex_detect_rts =
[
"/RT/",
"/RETWEET/i",
];
foreach ($regex_detect_rts as $regex_detect_rt) {
//if (strstr($string, $url)) { // mine version
preg_match($regex_detect_rt, $text, $invites);
if (isset($invites[0])) {
$rt = true;
}
}
//On verifie que si RT
if (isset($rt)) {
$inputs = array();
//On recherche la date de fin du concours
$date = $this->getDate($text);
if ($date != null) {
$fin = $date;
} else {
$fin = $this->getTwitterDate($created_at);
}
//On recherche la date de fin du concours
if ($fin >= Carbon::now()->format('Y-m-d')) {
$categorie = $this->getCategorie($text);
$organizer = $this->getOrganizer($screen);
$concours = Contest::create([
'category_id' => $categorie,
'organizer_id' => $organizer,
'description' => $text,
'url' => 'https://twitter.com/'.$screen.'/status/'.$id,
'tweetid' => $id,
'fin' => $fin,
'nbretweet' => $nbretweet,
'nblike' => $nblike,
'nbreply' => $nbreply,
]);
//On recherche un tag
$regex_detect_tags =
[
"/INVIT/i",
"/IDENTIFI/i",
"/TAG/i",
"/HASHTAG/i",
"/RT AVEC/i",
"/MENTIONN/i",
"/COMMENT/i",
"/RETWEET AVEC/i",
"/TWEET AVEC/i",
];
foreach ($regex_detect_tags as $regex_detect_tag) {
//if (strstr($string, $url)) { // mine version
preg_match($regex_detect_tag, $text, $invites);
if (isset($invites[0])) {
$tweet = true;
}
}
//On verifie s'il demande un tag ou un hashtag
if (isset($tweet)) {
$tag = 'Je veux gagner ce concours @ActuFoot_ @Mediavenir';
preg_match_all("/#[a-zA-Z0-9]+/", $text, $hashtag);
if (isset($hashtag[0])) {
$hashtags = implode(" ", $hashtag[0]);
$tag = $tag . ' ' . $hashtags;
}
$tag = urlencode($tag);
//On tweet avec un le tag
Action::create([
'contest_id' => $concours->id,
'type' => 'reply',
'value' => $tag,
]);
//On follow les autres
preg_match_all("/\s@([\w_-]+)/", $text, $matches);
$mentions = $matches[1];
$mentions[] = $screen;
$mentions = array_unique($mentions);
foreach ($mentions as $mention) {
Action::create([
'contest_id' => $concours->id,
'type' => 'follow',
'value' => $mention,
]);
}
//On like si besoin
preg_match("/LIKE/i", $text, $like);
if (isset($like[0])) {
Action::create([
'contest_id' => $concours->id,
'type' => 'like',
'value' => $id,
]);
}
} //Sinon on retweet tout simplement
else {
//On follow les autres
preg_match_all("/\s@([\w_-]+)/", $text, $matches);
$mentions = $matches[1];
$mentions[] = $screen;
$mentions = array_unique($mentions);
foreach ($mentions as $mention) {
Action::create([
'contest_id' => $concours->id,
'type' => 'follow',
'value' => $mention,
]);
}
//On like si besoin
preg_match("/LIKE/i", $text, $like);
if (isset($like[0])) {
Action::create([
'contest_id' => $concours->id,
'type' => 'like',
'value' => $id,
]);
}
}
}
}
}
});
} catch (\Exception $e) {
}
Cache::flush();
echo 'Fait !';
}
public function getOrganizer($screen)
{
$organiser = Organizer::where('screen_name', $screen)->first();
if ($organiser){
return $organiser->id;
}else
{
$client = new HttpBrowser(HttpClient::create(['verify_peer' => false, 'verify_host' => false, 'timeout' => '60']));
// Création des informations d'authentification
$username = 'autokdo';
$password = '@Gaudin95';
$credentials = base64_encode("$username:$password");
// Ajout des informations d'authentification à l'en-tête de la demande HTTP
$client->setServerParameter('HTTP_AUTHORIZATION', 'Basic ' . $credentials);
$client->setServerParameter('HTTP_USER_AGENT', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36');
$crawler = $client->request('GET', 'https://nitter-autokdo.fly.dev/'.$screen);
try{
$name = $crawler->filterXPath('//*[@class="profile-card-fullname"]')->text();
$description = $crawler->filterXPath('//*[@class="profile-bio"]')->text();
$profileUrl = $crawler->getUri();
$parsedUrl = parse_url($profileUrl);
$baseTwitterUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host'];
$image = $crawler->filterXPath('//meta[@property="og:image"]')->attr('content');
$url = str_replace("http://nitter-autokdo.fly.dev/pic/", "", $image);
$url = urldecode($url);
$url = 'https://'.$url;
$response = Http::get($url);
$contents = $response->body();
// Utilisation de getimagesize pour obtenir les informations sur l'image
$imageInfo = getimagesizefromstring($contents);
if ($imageInfo === false) {
$filename = 'icon-96x96.png';
}
$format = image_type_to_extension($imageInfo[2], false);
$filename = uniqid() . '.' . $format;
// Stocker l'image dans le répertoire 'ads' du stockage
Storage::put('/public/logo/'.$filename, $contents);
$organiser = Organizer::create([
'name' => $name,
'screen_name' => $screen,
'description' => $description,
'logo' => $filename,
'url' => 'https://twitter.com/'.$screen,
]);
return $organiser->id;
} catch (\Exception $e) {
dd($e);
}
}
}
private function getCategorie($data)
{
$client = new HttpBrowser(HttpClient::create(['verify_peer' => false, 'verify_host' => false, 'timeout' => '60']));
$client->request('GET', 'https://api.uclassify.com/v1/twittercontests/categories/classify/?readKey=c7ivTcoN2ycU&text='.$data);
$json = $client->getResponse()->getContent();
$array = json_decode($json,true);
$laravelArray = collect($array);
$laravelArray = $laravelArray->sortDesc();
$value = $laravelArray->first();
if($value < '0.5'){
$categorie = '20';
}
else{
$cat = $laravelArray->keys()->first();
if($cat == 'argent'){
$categorie = '1';
}elseif($cat == 'beaute'){
$categorie = '2';
}elseif($cat == 'console'){
$categorie = '3';
}elseif($cat == 'cuisine'){
$categorie = '4';
}elseif($cat == 'dvd'){
$categorie = '5';
}elseif($cat == 'enfant'){
$categorie = '6';
}elseif($cat == 'goodies'){
$categorie = '7';
}elseif($cat == 'invitation'){
$categorie = '8';
}elseif($cat == 'livre'){
$categorie = '9';
}elseif($cat == 'maison'){
$categorie = '10';
}elseif($cat == 'mode'){
$categorie = '11';
}elseif($cat == 'pc'){
$categorie = '12';
}elseif($cat == 'sport'){
$categorie = '13';
}elseif($cat == 'telephone'){
$categorie = '14';
}elseif($cat == 'voiture'){
$categorie = '15';
}elseif($cat == 'voyage'){
$categorie = '16';
}else{
$categorie = '20';
}
}
return $categorie;
}
private function getDate($string) {
// Pattern pour détecter les dates au format JJ/MM ou JJ.MM
$pattern_jjmm = '/\b(\d{1,2})(\/|\.)\d{1,2}\b/';
// Pattern pour détecter les dates du style "1 août" (ou autre mois en français)
$mois_fr = array(
'janvier', 'février', 'mars', 'avril', 'mai', 'juin',
'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'
);
$pattern_jj_mois_fr = '/\b(\d{1,2}) (' . implode('|', $mois_fr) . ')\b/i';
// Stocker les correspondances dans un tableau
$correspondances = array();
// Chercher les dates au format JJ/MM ou JJ.MM
if (preg_match_all($pattern_jjmm, $string, $matches)) {
$correspondances = array_merge($correspondances, $matches[0]);
}
// Chercher les dates du style "1 août" (ou autre mois en français)
if (preg_match_all($pattern_jj_mois_fr, $string, $matches)) {
// Convertir le mois en format numérique (1 pour janvier, 2 pour février, etc.)
$mois_numerique = array_flip($mois_fr);
foreach ($matches[2] as $index => $mois) {
$matches[0][$index] = $matches[1][$index] . '/' . str_pad($mois_numerique[strtolower($mois)] + 1, 2, '0', STR_PAD_LEFT);
}
$correspondances = array_merge($correspondances, $matches[0]);
}
// Vérifier s'il y a des dates détectées
if (empty($correspondances)) {
// Afficher une erreur si aucune date n'est détectée
return "";
}
// Récupérer la dernière date détectée
$derniere_date = end($correspondances);
// Convertir la dernière date au format "Y-m-d" (année-mois-jour)
if (strpos($derniere_date, '/') !== false) {
// Format JJ/MM
list($jour, $mois) = explode('/', $derniere_date);
$annee = date('Y');
} else {
// Format JJ.MM
list($jour, $mois) = explode('.', $derniere_date);
$annee = date('Y');
}
$date_convertie = date('Y-m-d', strtotime("$annee-$mois-$jour"));
return $date_convertie;
}
private function getTwitterDate($text){
// Utilisez une expression régulière pour extraire la date
$pattern = '/(\w{3} \d{1,2}, \d{4})/';
preg_match($pattern, $text, $matches);
if (count($matches) >= 2) {
// Format de date extrait
$dateString = $matches[1];
// Analyse de la date
$date = Carbon::createFromFormat('M d, Y', $dateString);
// Obtenez la date au format Y-m-d
$formattedDate = $date->addDays(1)->format('Y-m-d');
return $formattedDate;
} else {
return Carbon::now()->addDays(1)->format('Y-m-d');
}
}
}

View File

@@ -2,11 +2,7 @@
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
abstract class Controller
{
use AuthorizesRequests, ValidatesRequests;
//
}

View File

@@ -1,14 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
public function index()
{
return view('home');
}
}

View File

@@ -1,68 +0,0 @@
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array<string, array<int, class-string|string>>
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
/**
* The application's middleware aliases.
*
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
*
* @var array<string, class-string|string>
*/
protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
'signed' => \App\Http\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
}

View File

@@ -1,17 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*/
protected function redirectTo(Request $request): ?string
{
return $request->expectsJson() ? null : route('login');
}
}

View File

@@ -1,17 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View File

@@ -1,17 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View File

@@ -1,30 +0,0 @@
<?php
namespace App\Http\Middleware;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next, string ...$guards): Response
{
$guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
}
return $next($request);
}
}

View File

@@ -1,19 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array<int, string>
*/
protected $except = [
'current_password',
'password',
'password_confirmation',
];
}

View File

@@ -1,20 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustHosts as Middleware;
class TrustHosts extends Middleware
{
/**
* Get the host patterns that should be trusted.
*
* @return array<int, string|null>
*/
public function hosts(): array
{
return [
$this->allSubdomainsOfApplicationUrl(),
];
}
}

View File

@@ -1,28 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array<int, string>|string|null
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}

View File

@@ -1,22 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
class ValidateSignature extends Middleware
{
/**
* The names of the query string parameters that should be ignored.
*
* @var array<int, string>
*/
protected $except = [
// 'fbclid',
// 'utm_campaign',
// 'utm_content',
// 'utm_medium',
// 'utm_source',
// 'utm_term',
];
}

View File

@@ -1,17 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array<int, string>
*/
protected $except = [
//
];
}