]> _ Git - psq.git/commitdiff
adcampaign ckeditor
authorLouis Jeckel <louis.jeckel@outlook.cm>
Tue, 8 Sep 2020 17:14:41 +0000 (19:14 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Tue, 8 Sep 2020 17:14:41 +0000 (19:14 +0200)
app/Models/AdCampaign.php
app/Repositories/AdCampaignRepository.php
database/migrations/2020_09_08_171007_add_content_to_ad_campaigns_table.php [new file with mode: 0644]
resources/views/admin/adCampaigns/form.blade.php
resources/views/com-campaigns/show.blade.php

index b1c12d3151db48716df97d7aac8577a0889d1b4c..e101b46ebcbb9fc53b0230c827269e419fa09bdb 100644 (file)
@@ -17,7 +17,7 @@ use Laravel\Scout\Searchable;
  */
 class AdCampaign extends Model implements Sortable
 {
-    use HasSlug, HasMedias, HasPosition, HasBlocks;
+    use HasSlug, HasMedias, HasPosition;
     use Searchable;
 
     protected $fillable = [
@@ -25,6 +25,7 @@ class AdCampaign extends Model implements Sortable
         'title',
         'description',
         'position',
+        'content',
         'publish_start_date',
         'publish_end_date',
         'organization'
index 48f93f4fc362557197b192ec13301ea2fcfcdbe1..b8bed7003fc12e6361654d4e0c9b0601ea1887b6 100644 (file)
@@ -10,7 +10,7 @@ use App\Models\AdCampaign;
 
 class AdCampaignRepository extends ModuleRepository
 {
-    use HandleSlugs, HandleMedias, HandleBlocks;
+    use HandleSlugs, HandleMedias;
 
     public function __construct(AdCampaign $model)
     {
diff --git a/database/migrations/2020_09_08_171007_add_content_to_ad_campaigns_table.php b/database/migrations/2020_09_08_171007_add_content_to_ad_campaigns_table.php
new file mode 100644 (file)
index 0000000..666c0ac
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddContentToAdCampaignsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('ad_campaigns', function (Blueprint $table) {
+            $table->text('content')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('ad_campaigns', function (Blueprint $table) {
+            $table->dropColumn('content');
+        });
+    }
+}
index 6c545adb8e80fc3c43ff9dd3caaa4c1242d6fe2c..77733566ebb39182138d638c6c42fa456f4fcff3 100644 (file)
@@ -17,5 +17,8 @@
         'label' => 'Image',
     ])
 
-    @formField('block_editor', ['blocks' => ['image', 'text', 'youtube']])
+    @formField('ckeditor', [
+    'name' => 'content',
+    'label' => 'Article complet',
+])
 @stop
index 0772012c9bab3a1f3ceb2402cc3618be44e6a1b4..a69865a79fa2db5c3943dad2d0d9b4915c4a23f4 100644 (file)
@@ -7,12 +7,8 @@
 
         <h1>MARKETING & COM : LES CAMPAGNES DE LA SEMAINE</h1>
 
-        <div class="content">
-        <h2>{{$campaign->title}}</h2>
-        <div class="chapo">
-            {!! $campaign->description !!}
-        </div>
-            {!! $campaign->renderBlocks() !!}
+        <div class="content ck-content">
+            {!! $campaign->content !!}
         </div>
 
     </article>