]> _ Git - psq.git/commitdiff
wait #7163 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 Oct 2024 10:19:30 +0000 (11:19 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 31 Oct 2024 10:19:30 +0000 (11:19 +0100)
app/Http/Controllers/Admin/PublishController.php
config/twill-navigation.php
routes/admin.php

index ae2f2329a19064311dec213fc03e5a883c51b80f..d4d45c393ab675244425c87cb5a7fe554a0f4ca3 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 namespace App\Http\Controllers\Admin;
+
 use App\EmailBatch;
 use App\FileCollection;
 use App\FileTag;
@@ -57,7 +58,7 @@ class PublishController extends Controller
         $processEmailBatch = new ProcessEmailBatch($batch, $usersBuilder);
         dispatch($processEmailBatch);
 
-        if($pdfBatch = EmailBatch::createAttachmentMailFromRequest($data)) {
+        if ($pdfBatch = EmailBatch::createAttachmentMailFromRequest($data)) {
             $userReceivesPdfBuilder->subscriber()->receivesPdf();
             $pdfProcessEmailBatch = new ProcessEmailBatch($pdfBatch, $userReceivesPdfBuilder);
             dispatch($pdfProcessEmailBatch->withFile());
@@ -82,14 +83,12 @@ class PublishController extends Controller
     }
 
 
-
-
     /**
      * @return ResourceCollection
      */
     public function collections()
     {
-        $files = FileCollection::all()->map(function(FileCollection $fileCollection) {
+        $files = FileCollection::all()->map(function (FileCollection $fileCollection) {
             $fileCollection->files = [$fileCollection->files()->orderByDesc('updated_at')->first()];
             return $fileCollection;
         });
@@ -107,7 +106,7 @@ class PublishController extends Controller
      */
     public function tags()
     {
-        return ['data' => FileTag::query()->get()->map(function($tag) {
+        return ['data' => FileTag::query()->get()->map(function ($tag) {
             return [
                 'value' => $tag->content,
                 'text' => $tag->content
@@ -116,7 +115,6 @@ class PublishController extends Controller
     }
 
 
-
     /**
      * @return \Illuminate\View\View
      */
@@ -178,11 +176,13 @@ class PublishController extends Controller
      */
     public static function sendGroups(): array
     {
+        $test = 'test+psq@cubedesigners.com';
+
         return [
             'all' => [
                 'slug' => 'all',
                 'builder' => User::query(),
-                'text' =>  "Tout le monde",
+                'text' => "Tout le monde",
             ],
             'prospects' => [
                 'slug' => 'prospects',
@@ -205,16 +205,13 @@ class PublishController extends Controller
                 'text' => "Liste d'envoi quotidien"
             ],
             'louis' => [
-                'slug' => 'louis',
-                'builder' => User::where('email', 'louis.jeckel@outlook.com')
-                    ->orWhere('email', 'admin@prescription-quotidien.com'),
-                'text' => 'Louis (test)',
+                'slug' => 'cube',
+                'builder' => User::where('email', $test),
+                'text' => 'Test Fluidbook (test)',
             ],
             'admin' => [
                 'slug' => 'admin',
-                'builder' => User::where('email', 'louis.jeckel@outlook.com')
-                    ->orWhere('email', 'admin@prescription-quotidien.com')
-                    ->orWhere('email', 'olivier.robichon@prescription-quotidien.com'),
+                'builder' => User::whereIn('email', [$test, 'admin@prescription-quotidien.com', 'olivier.robichon@prescription-quotidien.com']),
                 'text' => 'Administrateurs (test)',
             ],
 
@@ -226,7 +223,7 @@ class PublishController extends Controller
      */
     public function sendGroupList()
     {
-        return response()->json(array_map(function($group) {
+        return response()->json(array_map(function ($group) {
             $group['count'] = $group['builder']->count();
             unset($group['builder']);
             $group['text'] .= " ({$group['count']})";
@@ -236,7 +233,4 @@ class PublishController extends Controller
     }
 
 
-
-
-
 }
index d24aad21860f2f2ce0a9d93068d5469f9ddb97ee..aebef0e866b83f535ad05ea2bb73fc3494d56f41 100644 (file)
@@ -23,6 +23,10 @@ return [
                 'title' => 'Lettres publiĆ©es',
                 'route' => 'admin.publish.pdfFiles.index'
             ],
+            'emailBatches' => [
+                'title' => 'Stats',
+                'module' => 'admin.publish.emailBatches',
+            ],
 
 
         ]
@@ -120,21 +124,7 @@ return [
 
         ]
     ],
-    'stats' => [
-        'title' => "Stats",
-        'route' => 'emailBatches.index',
-        'module' => true,
-        'primary_navigation' => [
-            'emailBatches' => [
-                'title' => 'Campagnes email',
-                'module' => true,
-            ],
-//            'prospects' => [
-//                'title' => 'Rapports de prospection',
-//                'route' => 'admin.stats.prospects'
-//            ]
-        ]
-    ]
+
 
 
 ];
index 794033ea5279e2ae99ec60f27d4e7d55b374be6f..34ea4f781f7b6823b5fb4cf895603d968ee99760 100644 (file)
@@ -38,7 +38,7 @@ Route::prefix('otherContent')->group(function () {
 });
 
 Route::prefix('stats')->group(function () {
-    Route::module('emailBatches');
+
 //
 //    Route::prefix('prospects')->group(function(){
 //        Route::get('/', 'ProspectStatsController@index')->name('stats.prospects');
@@ -69,6 +69,8 @@ Route::prefix('publish')->group(function() {
 
     });
 
+    Route::module('emailBatches');
+
 });
 
 Route::prefix('unlayer')->group(function(){