Ajout de l'affichage des account et contest dans l'app

This commit is contained in:
hugol
2024-11-18 18:25:41 +01:00
parent e79d64eb24
commit aab9af6372
12 changed files with 455 additions and 92 deletions

View File

@@ -129,11 +129,79 @@ class APIController extends Controller
]); ]);
} }
public function follow($user, $follow) public function follow($user, $tweetid)
{ {
$stack = $this->Oauth1($user); $stack = $this->Oauth1($user);
// Créer le client Guzzle avec le handler stack // Créer le client Guzzle avec le handler stack
$client = new Client([
'base_uri' => 'https://api.twitter.com/graphql/',
'handler' => $stack,
'proxy' => [
'http' => 'http://xtjnmwvl-'.$user->id.':lp7iv1lq9glu@p.webshare.io:80',
]
]);
$params = [
"variables" => [
"referrer" => "profile",
"includeTweetImpression" => true,
"includeHasBirdwatchNotes" => false,
"isReaderMode" => false,
"includeEditPerspective" => false,
"includeEditControl" => true,
"focalTweetId" => $tweetid,
"includeCommunityTweetRelationship" => true,
"includeTweetVisibilityNudge" => true,
],
"features" => [
"longform_notetweets_inline_media_enabled" => true,
"super_follow_badge_privacy_enabled" => true,
"longform_notetweets_rich_text_read_enabled" => true,
"super_follow_user_api_enabled" => true,
"unified_cards_ad_metadata_container_dynamic_card_content_query_enabled" => true,
"super_follow_tweet_api_enabled" => true,
"articles_api_enabled" => true,
"android_graphql_skip_api_media_color_palette" => true,
"creator_subscriptions_tweet_preview_api_enabled" => true,
"freedom_of_speech_not_reach_fetch_enabled" => true,
"tweetypie_unmention_optimization_enabled" => true,
"longform_notetweets_consumption_enabled" => true,
"subscriptions_verification_info_enabled" => true,
"blue_business_profile_image_shape_enabled" => true,
"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled" => true,
"immersive_video_status_linkable_timestamps" => true,
"super_follow_exclusive_tweet_notifications_enabled" => true,
],
];
// Effectuer la requête POST avec OAuth et les en-têtes personnalisés
$res = $client->get('NAHO_rBo3Yf1hBXROp7Msg/ConversationTimelineV2', [
'headers' => $this->twitterHeaders, // Ajouter les en-têtes ici
'auth' => 'oauth',
'json' => $params
]);
// Décoder le JSON en tableau PHP
$data = json_decode($res->getBody()->getContents(), true);
// Initialiser un tableau pour stocker les IDs
$userMentionIds = [];
// Extraire les IDs des mentions uniquement pour la première instruction et la première entrée
if (isset($data['data']['timeline_response']['instructions'][0]['entries'][0]['content']['content']['tweetResult']['result']['legacy']['entities']['user_mentions'])) {
$userMentionIds[] = $data['data']['timeline_response']['instructions'][0]['entries'][0]['content']['content']['tweetResult']['result']['legacy']['user_id_str'];
$mentions = $data['data']['timeline_response']['instructions'][0]['entries'][0]['content']['content']['tweetResult']['result']['legacy']['entities']['user_mentions'];
foreach ($mentions as $mention) {
$userMentionIds[] = $mention['id_str'];
}
}
$userMentionIds = array_unique($userMentionIds);
foreach ($userMentionIds as $mention) {
$stack = $this->Oauth1($user);
$client = new Client([ $client = new Client([
'base_uri' => 'https://api.twitter.com/1.1/', 'base_uri' => 'https://api.twitter.com/1.1/',
'handler' => $stack, 'handler' => $stack,
@@ -144,11 +212,12 @@ class APIController extends Controller
// Effectuer la requête POST avec OAuth et les en-têtes personnalisés // Effectuer la requête POST avec OAuth et les en-têtes personnalisés
$res = $client->post('friendships/create.json?screen_name='.$follow.'&follow=true', [ $res = $client->post('friendships/create.json?user_id='.$mention.'&ext=mediaRestrictions,altText,mediaStats,mediaColor,info360,highlightedLabel,unmentionInfo,editControl,previousCounts,limitedActionResults,superFollowMetadata&send_error_codes=true&handles_challenges=1', [
'headers' => $this->twitterHeaders, // Ajouter les en-têtes ici 'headers' => $this->twitterHeaders, // Ajouter les en-têtes ici
'auth' => 'oauth' // Assurez-vous que l'authentification OAuth est incluse 'auth' => 'oauth' // Assurez-vous que l'authentification OAuth est incluse
]); ]);
sleep(15);
}
} }
public function like($user, $tweetid) public function like($user, $tweetid)
@@ -259,7 +328,7 @@ class APIController extends Controller
$unred = json_decode($res->getBody()->getContents(), true); $unred = json_decode($res->getBody()->getContents(), true);
// L'URL des deux liens // L'URL des deux liens
$url = 'https://myx.ovh/nova/resources/accounts/'.$user->id; $url = 'https://myx.ovh/accounts/'.$user->id;
$keyboard = [ $keyboard = [
'inline_keyboard' => [ 'inline_keyboard' => [
@@ -579,6 +648,7 @@ class APIController extends Controller
'text' => $text, 'text' => $text,
]); ]);
} }
$stack = $this->Oauth1($user);
} }
} }

View File

@@ -3,9 +3,9 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Jobs\ProcessNews; use App\Jobs\ProcessNews;
use App\Jobs\ProcessTweet;
use App\Models\Account; use App\Models\Account;
use Illuminate\Support\Facades\Cache; use Artesaos\SEOTools\Facades\SEOTools;
use foroco\BrowserDetection;
use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Queue; use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
@@ -292,5 +292,33 @@ class AccountController extends Controller
} }
} }
public function all()
{
$accounts = Account::where('enable', true)->get();
$browser = new BrowserDetection();
$useragent = $_SERVER['HTTP_USER_AGENT'];
$browser = $browser->getOS($useragent);
SEOTools::setTitle('Liste des comptes');
return view('accounts.index', compact('accounts', 'browser'));
}
public function account($id)
{
$account = Account::find($id);
$browser = new BrowserDetection();
$useragent = $_SERVER['HTTP_USER_AGENT'];
$browser = $browser->getOS($useragent);
SEOTools::setTitle('Compte '.$account->name);
return view('accounts.view', compact('account', 'browser'));
}
} }

View File

@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Models\Block; use App\Models\Block;
use App\Models\Contest; use App\Models\Contest;
use Artesaos\SEOTools\Facades\SEOTools;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Http;
@@ -470,8 +471,15 @@ class ContestController extends Controller
return ""; // Retourne une chaîne vide si aucune date n'est trouvée return ""; // Retourne une chaîne vide si aucune date n'est trouvée
} }
// Récupérer la dernière date détectée // Si plusieurs dates sont trouvées, trier les dates et récupérer la dernière
$derniere_date = end($correspondances); usort($correspondances, function ($a, $b) {
$dateA = strtotime($a);
$dateB = strtotime($b);
return $dateB - $dateA; // Tri décroissant
});
// Récupérer la dernière date détectée après le tri
$derniere_date = $correspondances[0];
// Convertir la dernière date au format "Y-m-d" (année-mois-jour) // Convertir la dernière date au format "Y-m-d" (année-mois-jour)
if (strpos($derniere_date, '/') !== false) { if (strpos($derniere_date, '/') !== false) {
@@ -494,7 +502,7 @@ class ContestController extends Controller
} }
return $date_convertie; return $date_convertie;
} }
private function getTwitterDate($text) private function getTwitterDate($text)
{ {
@@ -503,8 +511,15 @@ class ContestController extends Controller
preg_match_all($pattern, $text, $matches); preg_match_all($pattern, $text, $matches);
if (!empty($matches[1])) { if (!empty($matches[1])) {
// Récupérer la dernière date trouvée // Trier les dates pour obtenir la plus récente (dernière)
$lastDateString = end($matches[1]); usort($matches[1], function ($a, $b) {
$dateA = Carbon::createFromFormat('M d, Y', $a);
$dateB = Carbon::createFromFormat('M d, Y', $b);
return $dateB->timestamp - $dateA->timestamp; // Tri décroissant
});
// Récupérer la dernière date trouvée après le tri
$lastDateString = $matches[1][0];
// Analyse de la date // Analyse de la date
$date = Carbon::createFromFormat('M d, Y', $lastDateString); $date = Carbon::createFromFormat('M d, Y', $lastDateString);
@@ -518,4 +533,15 @@ class ContestController extends Controller
return Carbon::now()->addDays(1)->format('Y-m-d'); return Carbon::now()->addDays(1)->format('Y-m-d');
} }
} }
public function all()
{
$contests = Contest::where('fin', '>=', Carbon::now()->format('Y-m-d'))->where('participated', 0)->where('enable', 1)->paginate(20);
$count = Contest::where('fin', '>=', Carbon::now()->format('Y-m-d'))->where('participated', 0)->where('enable', 1)->count();
SEOTools::setTitle('Les concours à venir');
return view('contests', compact('contests', 'count'));
}
} }

View File

@@ -12,6 +12,8 @@ class ProcessNews implements ShouldQueue
{ {
use Queueable; use Queueable;
public $timeout = 300;
private $authid; private $authid;
/** /**
@@ -32,6 +34,11 @@ class ProcessNews implements ShouldQueue
$user = Account::find($this->authid); $user = Account::find($this->authid);
try{ try{
//On check si le compte est ok
$API->check($user);
//On check les notifs
$API->unread($user); $API->unread($user);
if (Cache::has('news')) { if (Cache::has('news')) {
@@ -50,14 +57,14 @@ class ProcessNews implements ShouldQueue
foreach ($selectedArticles as $article) { foreach ($selectedArticles as $article) {
$tweetid = $article['conversation_id_str']; $tweetid = $article['conversation_id_str'];
$API->retweet($user, $tweetid); $API->retweet($user, $tweetid);
sleep(15); sleep(30);
} }
} }
}catch (Exception $exception){ }catch (Exception $exception){
$text = "Le compte Twitter " . $user->name . " : " . $exception->getMessage(); $text = "Le compte Twitter " . $user->name . " : " . $exception->getMessage();
// L'URL des deux liens // L'URL des deux liens
$url = 'https://myx.ovh/nova/resources/accounts/'.$user->id; $url = 'https://myx.ovh/accounts/'.$user->id;
$keyboard = [ $keyboard = [
'inline_keyboard' => [ 'inline_keyboard' => [

View File

@@ -16,7 +16,7 @@ class ProcessTweet implements ShouldQueue
{ {
use Queueable; use Queueable;
public $timeout = 90; public $timeout = 900;
public $tries = 1; public $tries = 1;
private $id; private $id;
@@ -54,10 +54,11 @@ class ProcessTweet implements ShouldQueue
$hashtags = $this->getHashtags($text); $hashtags = $this->getHashtags($text);
$follows = $this->getFollows($text);
$API = new APIController(); $API = new APIController();
//On check si le compte est ok
$API->check($user);
//On check les notifs //On check les notifs
$API->unread($user); $API->unread($user);
@@ -71,7 +72,6 @@ class ProcessTweet implements ShouldQueue
//On reply //On reply
$API->reply($user, $contest->tweetid, $retweet); $API->reply($user, $contest->tweetid, $retweet);
sleep(15);
}elseif(isset($tweetcomment) && isset($tags)) { }elseif(isset($tweetcomment) && isset($tags)) {
$comments = config('twitter.sentence_for_tag'); $comments = config('twitter.sentence_for_tag');
@@ -80,7 +80,6 @@ class ProcessTweet implements ShouldQueue
//On reply //On reply
$API->reply($user, $contest->tweetid, $retweet); $API->reply($user, $contest->tweetid, $retweet);
sleep(15);
}elseif(isset($tweetspecial)){ }elseif(isset($tweetspecial)){
@@ -88,7 +87,6 @@ class ProcessTweet implements ShouldQueue
//On reply //On reply
$API->reply($user, $contest->tweetid, $retweet); $API->reply($user, $contest->tweetid, $retweet);
sleep(15);
}elseif(isset($tweetcomment)){ }elseif(isset($tweetcomment)){
@@ -98,7 +96,6 @@ class ProcessTweet implements ShouldQueue
//On reply //On reply
$API->reply($user, $contest->tweetid, $retweet); $API->reply($user, $contest->tweetid, $retweet);
sleep(15);
}elseif(isset($tags)){ }elseif(isset($tags)){
@@ -106,23 +103,14 @@ class ProcessTweet implements ShouldQueue
//On reply //On reply
$API->reply($user, $contest->tweetid, $retweet); $API->reply($user, $contest->tweetid, $retweet);
}
sleep(15); sleep(15);
} //On follow
$API->follow($user, $contest->tweetid);
//On follow le créateur
$API->follow($user, $contest->screen);
sleep(15); sleep(15);
if(isset($follows)){
foreach ($follows as $follow){
//On folow les personnes demandées
$API->follow($user, $follow);
sleep(5);
}
}
//On like si besoin //On like si besoin
preg_match("/LIKE/i", $text, $like); preg_match("/LIKE/i", $text, $like);
if (isset($like[0])) { if (isset($like[0])) {
@@ -161,7 +149,7 @@ class ProcessTweet implements ShouldQueue
$text = "Le compte Twitter " . $user->name . " : " . $exception->getMessage(); $text = "Le compte Twitter " . $user->name . " : " . $exception->getMessage();
// L'URL des deux liens // L'URL des deux liens
$url = 'https://myx.ovh/nova/resources/accounts/'.$user->id; $url = 'https://myx.ovh/accounts/'.$user->id;
$keyboard = [ $keyboard = [
'inline_keyboard' => [ 'inline_keyboard' => [
@@ -258,27 +246,31 @@ class ProcessTweet implements ShouldQueue
//On recherche si ça demande un tag //On recherche si ça demande un tag
$word_tags = config('twitter.word_tag'); $word_tags = config('twitter.word_tag');
$combined_regex = implode('|', array_map('preg_quote', $word_tags, array_fill(0, count($word_tags), '/'))); $combined_regex = implode('|', array_map('preg_quote', $word_tags, array_fill(0, count($word_tags), '/')));
$tags = collect(config('twitter.tags'));
if (preg_match('/' . $combined_regex . '/i', $text, $matches)) { if (preg_match('/' . $combined_regex . '/i', $text, $matches)) {
//On recherche si ça demande 1 tag //On recherche si ça demande 1 tag
$one_people_lists = config('twitter.one_people_list'); $one_people_lists = config('twitter.one_people_list');
$combined_regex = implode('|', array_map('preg_quote', $one_people_lists, array_fill(0, count($one_people_lists), '/'))); $combined_regex = implode('|', array_map('preg_quote', $one_people_lists, array_fill(0, count($one_people_lists), '/')));
if (preg_match('/' . $combined_regex . '/i', $text, $matches)) { if (preg_match('/' . $combined_regex . '/i', $text, $matches)) {
return '@chauchettes'; $values = $tags->random(1);
return '@' . $values[0];
} }
//On recherche si ça demande 2 tags //On recherche si ça demande 2 tags
$two_people_lists = config('twitter.two_people_list'); $two_people_lists = config('twitter.two_people_list');
$combined_regex = implode('|', array_map('preg_quote', $two_people_lists, array_fill(0, count($two_people_lists), '/'))); $combined_regex = implode('|', array_map('preg_quote', $two_people_lists, array_fill(0, count($two_people_lists), '/')));
if (preg_match('/' . $combined_regex . '/i', $text, $matches)) { if (preg_match('/' . $combined_regex . '/i', $text, $matches)) {
return '@chauchettes @totorunior'; $values = $tags->random(2);
return '@' . $values[0]. ' @' . $values[1];
} }
//On recherche si ça demande 3 tags ou plus //On recherche si ça demande 3 tags ou plus
$three_or_more_people_lists = config('twitter.three_or_more_people_list'); $three_or_more_people_lists = config('twitter.three_or_more_people_list');
$combined_regex = implode('|', array_map('preg_quote', $three_or_more_people_lists, array_fill(0, count($three_or_more_people_lists), '/'))); $combined_regex = implode('|', array_map('preg_quote', $three_or_more_people_lists, array_fill(0, count($three_or_more_people_lists), '/')));
if (preg_match('/' . $combined_regex . '/i', $text, $matches)) { if (preg_match('/' . $combined_regex . '/i', $text, $matches)) {
return '@chauchettes @totorunior @crakotte84'; $values = $tags->random(3);
return '@' . $values[0]. ' @' . $values[1]. ' @' . $values[2];
} }
} }
} }

View File

@@ -589,4 +589,21 @@ return [
'freebets', 'freebets',
'rtbf' 'rtbf'
], ],
'tags' => [
"gl1tz_4ll",
'daizy_dit1',
"sheison447179",
"TourisTourisk",
"ptitemo43",
"newrayane11292",
"huhu80fr",
"birezievfr",
'malamomotic',
'wilaxe8',
'informilit13896',
'quoteur69',
'RipPony31340',
'FollowPurf47871',
],
]; ];

View File

@@ -0,0 +1,82 @@
@extends('layouts.app')
@section('content')
<div class="bg-body-light">
<div class="content content-full">
<div class="d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center">
<h1 class="flex-grow-1 fs-3 fw-semibold my-2 my-sm-3">Liste des comptes actifs</h1>
<nav class="flex-shrink-0 my-2 my-sm-0 ms-sm-3" aria-label="breadcrumb">
<ol class="breadcrumb">
</ol>
</nav>
</div>
</div>
</div>
<div class="content">
<div class="block">
<div class="block-content">
<div class="table-responsive">
<table class="table table-bordered table-striped table-vcenter js-dataTable-full">
<thead>
<tr>
<th class="text-center" style="width: 80px;">ID</th>
<th>Nom</th>
<th>Accès</th>
<th>Webmail</th>
<th>Voir</th>
</tr>
</thead>
<tbody>
@foreach($accounts as $account)
<tr>
<td class="text-center">{{$account->id}}</td>
<td class="text-center">{{$account->name}}</td>
<td class="text-center">
@if(str_contains($browser['os_family'], 'android'))
<a href="intent://x.com?auth_token={{$account->auth_token}}#Intent;package=com.kiwibrowser.browser;scheme=https;end" target="_blank" class="btn btn-alt-info me-1 mb-3">
<i class="fa fa-fw fa-lock opacity-50 me-1"></i>
</a>
@else
<a href="https://x.com?auth_token={{$account->auth_token}}" target="_blank" class="btn btn-alt-info me-1 mb-3">
<i class="fa fa-fw fa-lock opacity-50 me-1"></i>
</a>
@endif
</td>
<td class="text-center">
<a href="https://mail.myx.ovh/?postlogin&Email={{$account->rambler_email}}&Password={{$account->rambler_password}}" target="_blank" class="btn btn-alt-info me-1 mb-3">
<i class="fa fa-fw fa-mail-bulk opacity-50 me-1"></i>
</a>
</td>
<td class="text-center">
<a href="/accounts/{{$account->id}}" class="btn btn-alt-info me-1 mb-3">
<i class="fa fa-fw fa-eye opacity-50 me-1"></i>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@section('js')
<script src="{{url('/')}}/js/lib/jquery.min.js"></script>
<script src="{{url('/')}}/js/plugins/datatables/dataTables.min.js"></script>
<script src="{{url('/')}}/js/plugins/datatables-bs5/js/dataTables.bootstrap5.min.js"></script>
<script src="{{url('/')}}/js/plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="{{url('/')}}/js/plugins/datatables-responsive-bs5/js/responsive.bootstrap5.min.js"></script>
<script src="{{url('/')}}/js/plugins/datatables-buttons/dataTables.buttons.min.js"></script>
<script src="{{url('/')}}/js/plugins/datatables-buttons-bs5/js/buttons.bootstrap5.min.js"></script>
<script src="{{url('/')}}/js/plugins/datatables-buttons-jszip/jszip.min.js"></script>
<script src="{{url('/')}}/js/plugins/datatables-buttons-pdfmake/pdfmake.min.js"></script>
<script src="{{url('/')}}/js/plugins/datatables-buttons-pdfmake/vfs_fonts.js"></script>
<script src="{{url('/')}}/js/plugins/datatables-buttons/buttons.print.min.js"></script>
<script src="{{url('/')}}/js/plugins/datatables-buttons/buttons.html5.min.js"></script>
<script>
$(document).ready(function () {
$('.table').DataTable();
});
</script>
@endsection

View File

@@ -0,0 +1,57 @@
@extends('layouts.app')
@section('content')
<div class="bg-body-light">
<div class="content content-full">
<div class="d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center">
<h1 class="flex-grow-1 fs-3 fw-semibold my-2 my-sm-3">{{$account->name}}</h1>
<nav class="flex-shrink-0 my-2 my-sm-0 ms-sm-3" aria-label="breadcrumb">
<ol class="breadcrumb">
</ol>
</nav>
</div>
</div>
</div>
<div class="content">
<div class="block">
<div class="block-content table-responsive">
<p>
<strong>ID: </strong> {{$account->id}}
</p>
<p>
<strong>Nom: </strong> {{$account->name}}
</p>
<p>
<strong>Accès: </strong>
@if(str_contains($browser['os_family'], 'android'))
<a href="intent://x.com?auth_token={{$account->auth_token}}#Intent;package=com.kiwibrowser.browser;scheme=https;end" target="_blank" class="btn btn-alt-info me-1 mb-3">
<i class="fa fa-fw fa-lock opacity-50 me-1"></i>
</a>
@else
<a href="https://x.com?auth_token={{$account->auth_token}}" target="_blank" class="btn btn-alt-info me-1 mb-3">
<i class="fa fa-fw fa-lock opacity-50 me-1"></i>
</a>
@endif
</p>
<p>
<strong>Webmail: </strong>
<a href="https://mail.myx.ovh/?postlogin&Email={{$account->rambler_email}}&Password={{$account->rambler_password}}" target="_blank" class="btn btn-alt-info me-1 mb-3">
<i class="fa fa-fw fa-mail-bulk opacity-50 me-1"></i>
</a>
</p>
<P>
<strong>Voir: </strong>
<a href="https://myx.ovh/nova/resources/accounts/{{$account->id}}" target="_blank" class="btn btn-alt-info me-1 mb-3">
<i class="fa fa-fw fa-eye opacity-50 me-1"></i>
</a>
</P>
<p>
<strong>Auth Token:</strong> {{$account->auth_token}}
</p>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,72 @@
@extends('layouts.app')
@section('content')
<div class="bg-body-light">
<div class="content content-full">
<div class="d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center">
<h1 class="flex-grow-1 fs-3 fw-semibold my-2 my-sm-3">Liste des concours à venir ({{$count}})</h1>
<nav class="flex-shrink-0 my-2 my-sm-0 ms-sm-3" aria-label="breadcrumb">
<ol class="breadcrumb">
</ol>
</nav>
</div>
</div>
</div>
<div class="content">
<div class="row">
@foreach($contests as $contest)
<div class="col-md-6 my-2">
<div class="block block-rounded block-link-pop">
@if(isset($contest->picture))
<div class="block-content pb-8 bg-image" style="background-image: url('{{$contest->picture}}');">
@if($contest->participated)
<span class="badge bg-danger fw-bold p-2 text-uppercase">
Participé
</span>
@endif
</div>
@endif
<div class="block-content text-center">
<h4 class="mb-1">{{$contest->name}}</h4>
<p class="fs-sm">
Fin le <span class="text-primary"> {{ \Carbon\Carbon::parse($contest->fin)->format('d/m/y') }}</span>
</p>
<p>
{!! $contest->description !!}
</p>
<a href="{{$contest->url}}" target="_blank" class="btn btn-alt-info me-1 mb-3">
<i class="fa fa-fw fa-eye opacity-50 me-1"></i> Voir
</a>
<a href="https://myx.ovh/nova/resources/contests/{{$contest->id}}" target="_blank" class="btn btn-alt-success me-1 mb-3">
<i class="fa fa-fw fa-pen opacity-50 me-1"></i> Editer
</a>
</div>
<div class="block-content block-content-full bg-body-light">
<div class="row g-0 fs-sm text-center">
<div class="col-4">
<span class="text-muted fw-semibold">
<i class="fa fa-fw fa-heart opacity-50 me-1"></i> {{$contest->nblike}}
</span>
</div>
<div class="col-4">
<span class="text-muted fw-semibold">
<i class="fa fa-retweet fa-heart opacity-50 me-1"></i> {{$contest->nbreply}}
</span>
</div>
<div class="col-4">
<span class="text-muted fw-semibold">
<i class="fa fa-reply fa-comments opacity-50 me-1"></i> {{$contest->nbtweet}}
</span>
</div>
</div>
</div>
</div>
</div>
@endforeach
</div>
<div class="mb-3">
{!! $contests->links() !!}
</div>
</div>
@endsection

View File

@@ -57,11 +57,17 @@
</a> </a>
</li> </li>
<li class="nav-main-item"> <li class="nav-main-item">
<a class="nav-main-link" href="#"> <a class="nav-main-link" href="/accounts">
<i class="nav-main-link-icon fa fa-users"></i> <i class="nav-main-link-icon fa fa-users"></i>
<span class="nav-main-link-name">Accounts</span> <span class="nav-main-link-name">Accounts</span>
</a> </a>
</li> </li>
<li class="nav-main-item">
<a class="nav-main-link" href="/contests">
<i class="nav-main-link-icon fa fa-gifts"></i>
<span class="nav-main-link-name">Contests</span>
</a>
</li>
<li class="nav-main-item"> <li class="nav-main-item">
<a class="nav-main-link" href="/history"> <a class="nav-main-link" href="/history">
<i class="nav-main-link-icon fa fa-chart-line"></i> <i class="nav-main-link-icon fa fa-chart-line"></i>
@@ -134,5 +140,6 @@
</footer> </footer>
</div> </div>
@livewireScripts @livewireScripts
@yield('js')
</body> </body>
</html> </html>

View File

@@ -11,6 +11,11 @@ use Illuminate\Support\Facades\Route;
Route::get('/', [HomeController::class, 'index'])->middleware(['auth']); Route::get('/', [HomeController::class, 'index'])->middleware(['auth']);
Route::get('/history', [HomeController::class, 'history'])->middleware(['auth']); Route::get('/history', [HomeController::class, 'history'])->middleware(['auth']);
Route::get('/accounts', [AccountController::class, 'all'])->middleware(['auth']);
Route::get('/accounts/{id}', [AccountController::class, 'account'])->middleware(['auth']);
Route::get('/contests', [ContestController::class, 'all'])->middleware(['auth']);
Route::view('profile', 'profile.edit') Route::view('profile', 'profile.edit')
->name('profile.edit') ->name('profile.edit')
->middleware(['auth']); ->middleware(['auth']);