Cat преди 3 години
родител
ревизия
32efbd0586
променени са 3 файла, в които са добавени 47 реда и са изтрити 1 реда
  1. 26 0
      db/migrations/20221024101400_add_docs.php
  2. 21 0
      src/Models/Docs.php
  3. 0 1
      src/Services/Gateway/PaymentWall.php

+ 26 - 0
db/migrations/20221024101400_add_docs.php

@@ -0,0 +1,26 @@
+<?php
+
+declare(strict_types=1);
+
+use Phinx\Migration\AbstractMigration;
+
+final class AddDocs extends AbstractMigration
+{
+    public function up(): void
+    {
+        if (! $this->hasTable('docs')) {
+            $this->table('docs', [ 'id' => false, 'primary_key' => [ 'id' ]])
+                ->addColumn('id', 'biginteger', [ 'identity' => true,'signed' => false ])
+                ->addColumn('date', 'datetime', [])
+                ->addColumn('title', 'string', [])
+                ->addColumn('content', 'string', [])
+                ->addColumn('markdown', 'string', [])
+                ->create();
+        }
+    }
+
+    public function down(): void
+    {
+        $this->table('docs')->drop()->update();
+    }
+}

+ 21 - 0
src/Models/Docs.php

@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Models;
+
+/**
+ * Ann Model
+ *
+ * @property-read   int    $id         Document ID
+ *
+ * @property        string $date       Date document posted
+ * @property        string $title      Document title
+ * @property        string $content    Document in HTML
+ * @property        string $markdown   Document in MarkDown
+ */
+final class Ann extends Model
+{
+    protected $connection = 'default';
+    protected $table = 'docs';
+}

+ 0 - 1
src/Services/Gateway/PaymentWall.php

@@ -9,7 +9,6 @@ use App\Models\Payback;
 use App\Models\Setting;
 use App\Models\User;
 use App\Services\Auth;
-use App\Utils\Telegram;
 use Paymentwall_Config;
 use Paymentwall_Pingback;
 use Paymentwall_Widget;