]> _ Git - QuizFactory.git/commitdiff
wip #3439 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 27 Feb 2020 15:42:57 +0000 (16:42 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 27 Feb 2020 15:42:57 +0000 (16:42 +0100)
app/Http/Controllers/Admin/QuizCrudController.php [new file with mode: 0644]
composer.lock
config/backup.php [new file with mode: 0644]
config/filesystems.php
routes/backpack/custom.php

diff --git a/app/Http/Controllers/Admin/QuizCrudController.php b/app/Http/Controllers/Admin/QuizCrudController.php
new file mode 100644 (file)
index 0000000..5048ce6
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use Cubist\Backpack\app\Magic\Controllers\CubistMagicController;
+
+class QuizCrudController extends CubistMagicController
+{
+    protected $_modelNamespace = 'App\Models\Quiz';
+    protected $_routeURL = 'quiz';
+    protected $_singular = 'quiz';
+    protected $_plural = 'quizzes';
+    protected $_clonable = true;
+    protected $_bulk = true;
+    protected $_oneInstance= false;
+}
index 4eb88eb87a55750e176070b13c0b6727fe14a7be..8d976cc6af1cf7af023fb8b4e8dbb21b31e1f9e6 100644 (file)
             "source": {
                 "type": "git",
                 "url": "git://git.cubedesigners.com/cubist_cms-back.git",
-                "reference": "1f2b9016eea7ece363abb69d7e41def024a515d6"
+                "reference": "669fa5b2f62d2d8d513524b45e50968abe4b8dd9"
             },
             "dist": {
                 "type": "tar",
-                "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-2d1ce7.tar",
-                "reference": "1f2b9016eea7ece363abb69d7e41def024a515d6",
-                "shasum": "4f5ce3d2b5f4232826a42535141318d97efe926a"
+                "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-5868f3.tar",
+                "reference": "669fa5b2f62d2d8d513524b45e50968abe4b8dd9",
+                "shasum": "f0c60e405658dc08b596303ba802920ac5ff252e"
             },
             "require": {
                 "backpack/backupmanager": "^2.0",
                 }
             ],
             "description": "Cubist Backpack extension",
-            "time": "2020-02-26T16:22:36+00:00"
+            "time": "2020-02-27T15:33:23+00:00"
         },
         {
             "name": "cubist/cms-front",
         },
         {
             "name": "spatie/laravel-permission",
-            "version": "3.8.0",
+            "version": "3.9.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/spatie/laravel-permission.git",
-                "reference": "2339b6fae8f8aa5af047e1a0c54b6fb37546058a"
+                "reference": "ac0fc4cd809b1fe7ecbe9876e03bb5849601bf66"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/2339b6fae8f8aa5af047e1a0c54b6fb37546058a",
-                "reference": "2339b6fae8f8aa5af047e1a0c54b6fb37546058a",
+                "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/ac0fc4cd809b1fe7ecbe9876e03bb5849601bf66",
+                "reference": "ac0fc4cd809b1fe7ecbe9876e03bb5849601bf66",
                 "shasum": ""
             },
             "require": {
                 "security",
                 "spatie"
             ],
-            "time": "2020-02-18T21:16:24+00:00"
+            "time": "2020-02-26T16:23:16+00:00"
         },
         {
             "name": "spatie/laravel-sitemap",
diff --git a/config/backup.php b/config/backup.php
new file mode 100644 (file)
index 0000000..deaa8a4
--- /dev/null
@@ -0,0 +1,202 @@
+<?php
+
+return [
+
+    'backup' => [
+
+        /* --------------------------------------
+         * Backpack\BackupManager Command Flags
+         * --------------------------------------
+         * These flags will be attached every time a backup is triggered
+         * by Backpack\BackupManager. By default only notifications are disabled.
+         *
+         * https://docs.spatie.be/laravel-backup/v4/taking-backups/overview
+         * --only-to-disk=name-of-your-disk
+         * --only-db
+         * --only-files
+         * --disable-notifications
+         */
+        'backpack_flags' => [
+            '--disable-notifications'=> true,
+        ],
+
+        /*
+         * The name of this application. You can use this name to monitor
+         * the backups.
+         */
+        'name' => env('APP_URL'),
+
+        'source' => [
+
+            'files' => [
+
+                /*
+                 * The list of directories that should be part of the backup. You can
+                 * specify individual files as well.
+                 */
+                'include' => [
+                    base_path(),
+                ],
+
+                /*
+                 * These directories will be excluded from the backup.
+                 * You can specify individual files as well.
+                 */
+                'exclude' => [
+                    base_path('vendor'),
+                    storage_path(),
+                ],
+
+                /*
+                 * Determines if symlinks should be followed.
+                 */
+                'followLinks' => false,
+            ],
+
+            /*
+             * The names of the connections to the databases that should be part of the backup.
+             * Currently only MySQL- and PostgreSQL-databases are supported.
+             */
+            'databases' => [
+                'mysql',
+            ],
+        ],
+
+        /*
+         * The database dump can be gzipped to decrease diskspace usage.
+         */
+        'gzip_database_dump' => false,
+
+        'destination' => [
+
+            /*
+             * The filename prefix used for the backup zip file.
+             */
+            'filename_prefix' => '',
+
+            /*
+             * The disk names on which the backups will be stored.
+             */
+            'disks' => [
+                'backups',
+            ],
+        ],
+
+        'temporary_directory' => storage_path('app/backup-temp'),
+    ],
+
+    /*
+     * You can get notified when specific events occur. Out of the box you can use 'mail' and 'slack'.
+     * For Slack you need to install guzzlehttp/guzzle.
+     *
+     * You can also use your own notification classes, just make sure the class is named after one of
+     * the `Spatie\Backup\Events` classes.
+     */
+    'notifications' => [
+
+        'notifications' => [
+            \Spatie\Backup\Notifications\Notifications\BackupHasFailed::class         => ['mail'],
+            \Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFound::class => ['mail'],
+            \Spatie\Backup\Notifications\Notifications\CleanupHasFailed::class        => ['mail'],
+            \Spatie\Backup\Notifications\Notifications\BackupWasSuccessful::class     => ['mail'],
+            \Spatie\Backup\Notifications\Notifications\HealthyBackupWasFound::class   => ['mail'],
+            \Spatie\Backup\Notifications\Notifications\CleanupWasSuccessful::class    => ['mail'],
+        ],
+
+        /*
+         * Here you can specify the notifiable to which the notifications should be sent. The default
+         * notifiable will use the variables specified in this config file.
+         */
+        'notifiable' => \Spatie\Backup\Notifications\Notifiable::class,
+
+        /*
+         * Here you can specify how emails should be sent.
+         */
+        'mail' => [
+            'to'   => 'your@email.com',
+        ],
+
+        /*
+         * Here you can specify how messages should be sent to Slack.
+         */
+        'slack' => [
+            'webhook_url' => '',
+
+            /*
+             * If this is set to null the default channel of the webhook will be used.
+             */
+            'channel' => null,
+        ],
+    ],
+
+    /*
+     * Here you can specify which backups should be monitored.
+     * If a backup does not meet the specified requirements the
+     * UnHealthyBackupWasFound event will be fired.
+     */
+    'monitorBackups' => [
+        [
+            'name'                                   => env('APP_NAME'),
+            'disks'                                  => ['backups'],
+            'newestBackupsShouldNotBeOlderThanDays'  => 1,
+            'storageUsedMayNotBeHigherThanMegabytes' => 5000,
+        ],
+
+        /*
+        [
+            'name' => 'name of the second app',
+            'disks' => ['local', 's3'],
+            'newestBackupsShouldNotBeOlderThanDays' => 1,
+            'storageUsedMayNotBeHigherThanMegabytes' => 5000,
+        ],
+        */
+    ],
+
+    'cleanup' => [
+        /*
+         * The strategy that will be used to cleanup old backups. The default strategy
+         * will keep all backups for a certain amount of days. After that period only
+         * a daily backup will be kept. After that period only weekly backups will
+         * be kept and so on.
+         *
+         * No matter how you configure it the default strategy will never
+         * delete the newest backup.
+         */
+        'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class,
+
+        'defaultStrategy' => [
+
+            /*
+             * The number of days for which backups must be kept.
+             */
+            'keepAllBackupsForDays' => 7,
+
+            /*
+             * The number of days for which daily backups must be kept.
+             */
+            'keepDailyBackupsForDays' => 16,
+
+            /*
+             * The number of weeks for which one weekly backup must be kept.
+             */
+            'keepWeeklyBackupsForWeeks' => 8,
+
+            /*
+             * The number of months for which one monthly backup must be kept.
+             */
+            'keepMonthlyBackupsForMonths' => 4,
+
+            /*
+             * The number of years for which one yearly backup must be kept.
+             */
+            'keepYearlyBackupsForYears' => 2,
+
+            /*
+             * After cleaning up the backups remove the oldest backup until
+             * this amount of megabytes has been reached.
+             */
+            'deleteOldestBackupsWhenUsingMoreMegabytesThan' => 5000,
+        ],
+    ],
+
+];
index ec6a7cec3ae201836e51beeba07615b88c8e2d2a..792ff1abd139994c7667f09a8d72f6c72d9fd451 100644 (file)
@@ -64,6 +64,16 @@ return [
             'url' => env('AWS_URL'),
         ],
 
+        // used for Backpack/BackupManager
+        'backups' => [
+            'driver' => 'local',
+            'root'   => storage_path('backups'), // that's where your backups are stored by default: storage/backups
+        ],
+
+        'storage' => [
+            'driver' => 'local',
+            'root'   => storage_path(),
+        ],
     ],
 
 ];
index 85e8c9791f9fb9abdddc235199cc450e82837f2c..c2f7f550c3729e5ec4a5b71d7ac8a500e75f99c3 100644 (file)
@@ -1,14 +1,8 @@
 <?php
-
-// --------------------------
-// Custom Backpack Routes
-// --------------------------
-// This route file is loaded automatically by Backpack\Base.
-// Routes you generate using Backpack\Generators will be placed here.
-
 Route::group([
     'prefix'     => config('backpack.base.route_prefix', 'admin'),
     'middleware' => ['web', config('backpack.base.middleware_key', 'admin')],
     'namespace'  => 'App\Http\Controllers\Admin',
 ], function () { // custom admin routes
-}); // this should be the absolute last line of this file
+
+});