From: Louis Jeckel Date: Mon, 4 May 2020 15:20:01 +0000 (+0200) Subject: added articles, events, ad campaigns X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7a14833cf10ce3db47e72918475d9a354bc76f11;p=psq.git added articles, events, ad campaigns --- diff --git a/.idea/lettre-pharma.iml b/.idea/lettre-pharma.iml index e91b2f6..9e477f9 100644 --- a/.idea/lettre-pharma.iml +++ b/.idea/lettre-pharma.iml @@ -16,7 +16,9 @@ + + @@ -37,6 +39,7 @@ + @@ -49,12 +52,15 @@ + + + diff --git a/.idea/php.xml b/.idea/php.xml index 748259a..e5244e6 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -193,6 +193,12 @@ + + + + + + diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 59c585d..aff42ab 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -36,9 +36,12 @@ class Handler extends ExceptionHandler */ public function report(Throwable $exception) { + if (app()->bound('sentry') && $this->shouldReport($exception)) { + app('sentry')->captureException($exception); + } + parent::report($exception); } - /** * Render an exception into an HTTP response. * diff --git a/app/Http/Controllers/Admin/AdCampaignController.php b/app/Http/Controllers/Admin/AdCampaignController.php new file mode 100644 index 0000000..7ccac6e --- /dev/null +++ b/app/Http/Controllers/Admin/AdCampaignController.php @@ -0,0 +1,10 @@ + new LaravelResponseFactory($request), + 'source' => Storage::cloud()->getDriver(), + 'cache' => $filesystem->getDriver(), + 'cache_path_prefix' => '.cache', + 'base_url' => 'images', + 'driver' => 'imagick', + 'cache_with_file_extensions' => true + ]); + + + $img = $server->makeImage($path, request()->all()); + +// $file = Storage::get($img); +// $type = Storage::mimeType($img); +// +// $response = Response::make($file, 200); +// +// $response->header("Content-Type", $type); + +// return $response; + + \Image::make($filesystem->get($img))->response(); + + return $server->getImageResponse($path, request()->all()); + + } +} diff --git a/app/Http/Requests/Admin/AdCampaignRequest.php b/app/Http/Requests/Admin/AdCampaignRequest.php new file mode 100644 index 0000000..d933a64 --- /dev/null +++ b/app/Http/Requests/Admin/AdCampaignRequest.php @@ -0,0 +1,18 @@ + [ + 'desktop' => [ + [ + 'name' => 'desktop', + 'ratio' => 16 / 9, + ], + ], + 'mobile' => [ + [ + 'name' => 'mobile', + 'ratio' => 1, + ], + ], + 'flexible' => [ + [ + 'name' => 'free', + 'ratio' => 0, + ], + [ + 'name' => 'landscape', + 'ratio' => 16 / 9, + ], + [ + 'name' => 'portrait', + 'ratio' => 3 / 5, + ], + ], + ], + ]; +} diff --git a/app/Models/Article.php b/app/Models/Article.php new file mode 100644 index 0000000..ca3b4d6 --- /dev/null +++ b/app/Models/Article.php @@ -0,0 +1,58 @@ + [ + 'desktop' => [ + [ + 'name' => 'desktop', + 'ratio' => 16 / 9, + ], + ], + 'mobile' => [ + [ + 'name' => 'mobile', + 'ratio' => 1, + ], + ], + 'flexible' => [ + [ + 'name' => 'free', + 'ratio' => 0, + ], + [ + 'name' => 'landscape', + 'ratio' => 16 / 9, + ], + [ + 'name' => 'portrait', + 'ratio' => 3 / 5, + ], + ], + ], + ]; +} diff --git a/app/Models/Event.php b/app/Models/Event.php new file mode 100644 index 0000000..6d795d5 --- /dev/null +++ b/app/Models/Event.php @@ -0,0 +1,53 @@ + [ + 'desktop' => [ + [ + 'name' => 'desktop', + 'ratio' => 16 / 9, + ], + ], + 'mobile' => [ + [ + 'name' => 'mobile', + 'ratio' => 1, + ], + ], + 'flexible' => [ + [ + 'name' => 'free', + 'ratio' => 0, + ], + [ + 'name' => 'landscape', + 'ratio' => 16 / 9, + ], + [ + 'name' => 'portrait', + 'ratio' => 3 / 5, + ], + ], + ], + ]; +} diff --git a/app/Models/Revisions/ArticleRevision.php b/app/Models/Revisions/ArticleRevision.php new file mode 100644 index 0000000..92c8897 --- /dev/null +++ b/app/Models/Revisions/ArticleRevision.php @@ -0,0 +1,10 @@ +model = $model; + } +} diff --git a/app/Repositories/ArticleRepository.php b/app/Repositories/ArticleRepository.php new file mode 100644 index 0000000..d830436 --- /dev/null +++ b/app/Repositories/ArticleRepository.php @@ -0,0 +1,20 @@ +model = $model; + } +} diff --git a/app/Repositories/EventRepository.php b/app/Repositories/EventRepository.php new file mode 100644 index 0000000..dabe180 --- /dev/null +++ b/app/Repositories/EventRepository.php @@ -0,0 +1,18 @@ +model = $model; + } +} diff --git a/composer.json b/composer.json index 203d856..6eeb9fb 100644 --- a/composer.json +++ b/composer.json @@ -28,10 +28,13 @@ "laravel/nova": "~3.0", "laravel/scout": "^8.0", "laravel/tinker": "^2.0", + "league/glide": "^1.5", + "league/glide-laravel": "^1.0", "league/html-to-markdown": "^4.9", "mailgun/mailgun-php": "^3.0", "nyholm/psr7": "^1.2", "pusher/pusher-php-server": "~4.0", + "sentry/sentry-laravel": "1.7.1", "spatie/pdf-to-image": "^2.0", "spatie/pdf-to-text": "^1.3", "vaites/php-apache-tika": "^0.9.1" diff --git a/composer.lock b/composer.lock index 6437f37..e07c5d0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dd380938d2af9ce010a6b0c03d32998e", + "content-hash": "619658d66882bcbce2ed61728005dc01", "packages": [ { "name": "algolia/algoliasearch-client-php", @@ -794,6 +794,61 @@ ], "time": "2020-04-19T11:20:08+00:00" }, + { + "name": "composer/package-versions-deprecated", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "98df7f1b293c0550bd5b1ce6b60b59bdda23aa47" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/98df7f1b293c0550bd5b1ce6b60b59bdda23aa47", + "reference": "98df7f1b293c0550bd5b1ce6b60b59bdda23aa47", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7" + }, + "replace": { + "ocramius/package-versions": "1.2 - 1.8.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2020-04-23T11:49:37+00:00" + }, { "name": "dasprid/enum", "version": "1.0.0", @@ -1937,6 +1992,56 @@ ], "time": "2019-07-01T23:21:34+00:00" }, + { + "name": "http-interop/http-factory-guzzle", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/http-interop/http-factory-guzzle.git", + "reference": "34861658efb9899a6618cef03de46e2a52c80fc0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/34861658efb9899a6618cef03de46e2a52c80fc0", + "reference": "34861658efb9899a6618cef03de46e2a52c80fc0", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.4.2", + "psr/http-factory": "^1.0" + }, + "provide": { + "psr/http-factory-implementation": "^1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.5", + "phpunit/phpunit": "^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Factory\\Guzzle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "An HTTP Factory using Guzzle PSR7", + "keywords": [ + "factory", + "http", + "psr-17", + "psr-7" + ], + "time": "2018-07-31T19:32:56+00:00" + }, { "name": "imgix/imgix-php", "version": "3.2.0", @@ -2191,6 +2296,57 @@ "abandoned": "php-parallel-lint/php-console-highlighter", "time": "2018-09-29T18:48:56+00:00" }, + { + "name": "jean85/pretty-package-versions", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "e3517fb11b67e798239354fe8213927d012ad8f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/e3517fb11b67e798239354fe8213927d012ad8f9", + "reference": "e3517fb11b67e798239354fe8213927d012ad8f9", + "shasum": "" + }, + "require": { + "composer/package-versions-deprecated": "^1.8.0", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "time": "2020-04-24T14:19:45+00:00" + }, { "name": "kriswallsmith/buzz", "version": "1.1.0", @@ -4833,6 +4989,69 @@ ], "time": "2020-01-03T11:25:47+00:00" }, + { + "name": "php-http/guzzle6-adapter", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/guzzle6-adapter.git", + "reference": "6074a4b1f4d5c21061b70bab3b8ad484282fe31f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/6074a4b1f4d5c21061b70bab3b8ad484282fe31f", + "reference": "6074a4b1f4d5c21061b70bab3b8ad484282fe31f", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": "^7.1", + "php-http/httplug": "^2.0", + "psr/http-client": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0", + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "php-http/client-integration-tests": "^2.0", + "phpunit/phpunit": "^7.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle6\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "David de Boer", + "email": "david@ddeboer.nl" + } + ], + "description": "Guzzle 6 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], + "time": "2018-12-16T14:44:03+00:00" + }, { "name": "php-http/httplug", "version": "2.1.0", @@ -6261,6 +6480,193 @@ ], "time": "2019-02-22T07:42:52+00:00" }, + { + "name": "sentry/sdk", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/getsentry/sentry-php-sdk.git", + "reference": "18921af9c2777517ef9fb480845c22a98554d6af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/18921af9c2777517ef9fb480845c22a98554d6af", + "reference": "18921af9c2777517ef9fb480845c22a98554d6af", + "shasum": "" + }, + "require": { + "http-interop/http-factory-guzzle": "^1.0", + "php-http/guzzle6-adapter": "^1.1|^2.0", + "sentry/sentry": "^2.3" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sentry", + "email": "accounts@sentry.io" + } + ], + "description": "This is a metapackage shipping sentry/sentry with a recommended http client.", + "time": "2020-01-08T19:16:29+00:00" + }, + { + "name": "sentry/sentry", + "version": "2.3.2", + "source": { + "type": "git", + "url": "https://github.com/getsentry/sentry-php.git", + "reference": "b3e71feb32f1787b66a3b4fdb8686972e9c7ba94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/b3e71feb32f1787b66a3b4fdb8686972e9c7ba94", + "reference": "b3e71feb32f1787b66a3b4fdb8686972e9c7ba94", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/promises": "^1.3", + "guzzlehttp/psr7": "^1.6", + "jean85/pretty-package-versions": "^1.2", + "php": "^7.1", + "php-http/async-client-implementation": "^1.0", + "php-http/client-common": "^1.5|^2.0", + "php-http/discovery": "^1.6.1", + "php-http/httplug": "^1.1|^2.0", + "php-http/message": "^1.5", + "psr/http-message-implementation": "^1.0", + "symfony/options-resolver": "^2.7|^3.0|^4.0|^5.0", + "symfony/polyfill-uuid": "^1.13.1" + }, + "conflict": { + "php-http/client-common": "1.8.0", + "raven/raven": "*" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.13", + "monolog/monolog": "^1.3|^2.0", + "php-http/mock-client": "^1.3", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpunit/phpunit": "^7.5.18", + "symfony/phpunit-bridge": "^4.3|^5.0", + "vimeo/psalm": "^3.4" + }, + "suggest": { + "monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Sentry\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sentry", + "email": "accounts@sentry.io" + } + ], + "description": "A PHP SDK for Sentry (http://sentry.io)", + "homepage": "http://sentry.io", + "keywords": [ + "crash-reporting", + "crash-reports", + "error-handler", + "error-monitoring", + "log", + "logging", + "sentry" + ], + "time": "2020-03-06T09:24:53+00:00" + }, + { + "name": "sentry/sentry-laravel", + "version": "1.7.1", + "source": { + "type": "git", + "url": "https://github.com/getsentry/sentry-laravel.git", + "reference": "8ec4695c5c6fa28d952c0f361e02997e84920354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/8ec4695c5c6fa28d952c0f361e02997e84920354", + "reference": "8ec4695c5c6fa28d952c0f361e02997e84920354", + "shasum": "" + }, + "require": { + "illuminate/support": "5.0 - 5.8 | ^6.0 | ^7.0", + "php": "^7.1", + "sentry/sdk": "^2.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.14.*", + "laravel/framework": "^6.0", + "orchestra/testbench": "^3.9", + "phpunit/phpunit": "^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev", + "dev-0.x": "0.x-dev" + }, + "laravel": { + "providers": [ + "Sentry\\Laravel\\ServiceProvider" + ], + "aliases": { + "Sentry": "Sentry\\Laravel\\Facade" + } + } + }, + "autoload": { + "psr-0": { + "Sentry\\Laravel\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Sentry", + "email": "accounts@sentry.io" + } + ], + "description": "Laravel SDK for Sentry (https://sentry.io)", + "homepage": "https://sentry.io", + "keywords": [ + "crash-reporting", + "crash-reports", + "error-handler", + "error-monitoring", + "laravel", + "log", + "logging", + "sentry" + ], + "time": "2020-04-01T10:30:44+00:00" + }, { "name": "spatie/laravel-activitylog", "version": "3.14.1", @@ -7922,6 +8328,65 @@ ], "time": "2020-02-27T09:26:54+00:00" }, + { + "name": "symfony/polyfill-uuid", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-uuid.git", + "reference": "2318f7f470a892867f3de602e403d006b1b9c9aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/2318f7f470a892867f3de602e403d006b1b9c9aa", + "reference": "2318f7f470a892867f3de602e403d006b1b9c9aa", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" + }, + "suggest": { + "ext-uuid": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Uuid\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for uuid functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "uuid" + ], + "time": "2020-03-23T13:44:10+00:00" + }, { "name": "symfony/process", "version": "v5.0.7", diff --git a/config/app.php b/config/app.php index fa48a5f..9b4aded 100644 --- a/config/app.php +++ b/config/app.php @@ -234,5 +234,4 @@ return [ 'Asset' => App\Helpers\Asset::class, ], - ]; diff --git a/config/glide.php b/config/glide.php new file mode 100644 index 0000000..c5fc09b --- /dev/null +++ b/config/glide.php @@ -0,0 +1,44 @@ + env('GLIDE_SOURCE', storage_path('app/public/' . config('twill.media_library.local_path'))), + 'cache' => env('GLIDE_CACHE', storage_path('app')), + 'cache_path_prefix' => env('GLIDE_CACHE_PATH_PREFIX', 'glide_cache'), + 'base_url' => env('GLIDE_BASE_URL', 'http://localhost:8001'), + 'base_path' => env('GLIDE_BASE_PATH', 'images'), + 'use_signed_urls' => env('GLIDE_USE_SIGNED_URLS', false), + 'sign_key' => env('GLIDE_SIGN_KEY'), + 'driver' => env('GLIDE_DRIVER', 'gd'), + 'add_params_to_svgs' => false, + 'default_params' => [ + 'fm' => 'jpg', + 'q' => '80', + 'fit' => 'max', + ], + 'lqip_default_params' => [ + 'fm' => 'gif', + 'blur' => 100, + 'dpr' => 1, + ], + 'social_default_params' => [ + 'fm' => 'jpg', + 'w' => 900, + 'h' => 470, + 'fit' => 'crop', + ], + 'cms_default_params' => [ + 'q' => '60', + 'dpr' => '1', + ], + 'presets' => [], +]; diff --git a/config/sentry.php b/config/sentry.php new file mode 100644 index 0000000..0f17163 --- /dev/null +++ b/config/sentry.php @@ -0,0 +1,24 @@ + env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), + + // capture release as git sha + 'release' => trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')), + + 'breadcrumbs' => [ + // Capture Laravel logs in breadcrumbs + 'logs' => true, + + // Capture SQL queries in breadcrumbs + 'sql_queries' => true, + + // Capture bindings on SQL queries logged in breadcrumbs + 'sql_bindings' => true, + + // Capture queue job information in breadcrumbs + 'queue_info' => true, + ], + +]; diff --git a/config/twill-navigation.php b/config/twill-navigation.php index 124fe58..55db34d 100644 --- a/config/twill-navigation.php +++ b/config/twill-navigation.php @@ -16,6 +16,21 @@ return [ 'title' => 'PdfFiles', 'module' => true ], + 'adCampaigns' => [ + 'title' => 'AdCampaigns', + 'module' => true + ], + 'events' => [ + 'title' => 'Events', + 'module' => true + ], + 'articles' => [ + 'title' => 'Articles', + 'module' => true + ], + + + 'featured' => [ 'title' => 'Features', 'route' => 'admin.featured.homepage', diff --git a/config/twill.php b/config/twill.php index 5dc4373..e9449d8 100644 --- a/config/twill.php +++ b/config/twill.php @@ -192,7 +192,7 @@ return [ */ 'js_namespace' => 'TWILL', 'dev_mode' => false, - 'dev_mode_url' => env('TWILL_DEV_MODE_URL', 'http://localhost:8080'), + 'dev_mode_url' => env('TWILL_DEV_MODE_URL', 'http://localhost:8001'), 'public_directory' => env('TWILL_ASSETS_DIR', 'assets/admin'), 'manifest_file' => 'twill-manifest.json', 'vendor_path' => 'vendor/area17/twill', @@ -207,4 +207,9 @@ return [ */ 'locale' => 'fr', 'fallback_locale' => 'en', + + 'media_library' => [ + 'image_service' => \A17\Twill\Services\MediaLibrary\Glide::class, + ] + ]; diff --git a/database/migrations/2020_05_02_130231_create_ad_campaigns_tables.php b/database/migrations/2020_05_02_130231_create_ad_campaigns_tables.php new file mode 100644 index 0000000..05b2474 --- /dev/null +++ b/database/migrations/2020_05_02_130231_create_ad_campaigns_tables.php @@ -0,0 +1,44 @@ +string('title', 200)->nullable(); + + // your generated model and form include a description field, to get you started, but feel free to get rid of it if you don't need it + $table->text('description')->nullable(); + $table->string('url')->nullable(); + + $table->string('organization')->nullable(); + + + $table->integer('position')->unsigned()->nullable(); + + // add those 2 columns to enable publication timeframe fields (you can use publish_start_date only if you don't need to provide the ability to specify an end date) + $table->timestamp('publish_start_date')->nullable(); + $table->timestamp('publish_end_date')->nullable(); + }); + + Schema::create('ad_campaign_slugs', function (Blueprint $table) { + createDefaultSlugsTableFields($table, 'ad_campaign'); + }); + + + } + + public function down() + { + + Schema::dropIfExists('ad_campaign_slugs'); + Schema::dropIfExists('ad_campaigns'); + } +} diff --git a/database/migrations/2020_05_02_130334_create_events_tables.php b/database/migrations/2020_05_02_130334_create_events_tables.php new file mode 100644 index 0000000..62227ae --- /dev/null +++ b/database/migrations/2020_05_02_130334_create_events_tables.php @@ -0,0 +1,44 @@ +string('title', 200)->nullable(); + + // your generated model and form include a description field, to get you started, but feel free to get rid of it if you don't need it + $table->text('description')->nullable(); + + $table->dateTime('start_date'); + $table->dateTime('end_date')->nullable(); + $table->string('organizer')->nullable(); + + + + // add those 2 columns to enable publication timeframe fields (you can use publish_start_date only if you don't need to provide the ability to specify an end date) + // $table->timestamp('publish_start_date')->nullable(); + // $table->timestamp('publish_end_date')->nullable(); + }); + + Schema::create('event_slugs', function (Blueprint $table) { + createDefaultSlugsTableFields($table, 'event'); + }); + + + } + + public function down() + { + + Schema::dropIfExists('event_slugs'); + Schema::dropIfExists('events'); + } +} diff --git a/database/migrations/2020_05_02_130503_create_articles_tables.php b/database/migrations/2020_05_02_130503_create_articles_tables.php new file mode 100644 index 0000000..612bf0e --- /dev/null +++ b/database/migrations/2020_05_02_130503_create_articles_tables.php @@ -0,0 +1,42 @@ +string('title', 200)->nullable(); + + // your generated model and form include a description field, to get you started, but feel free to get rid of it if you don't need it + $table->text('description')->nullable(); + + $table->integer('position')->unsigned()->nullable(); + + // add those 2 columns to enable publication timeframe fields (you can use publish_start_date only if you don't need to provide the ability to specify an end date) + $table->timestamp('publish_start_date')->nullable(); + // $table->timestamp('publish_end_date')->nullable(); + }); + + Schema::create('article_slugs', function (Blueprint $table) { + createDefaultSlugsTableFields($table, 'article'); + }); + + Schema::create('article_revisions', function (Blueprint $table) { + createDefaultRevisionsTableFields($table, 'article'); + }); + } + + public function down() + { + Schema::dropIfExists('article_revisions'); + Schema::dropIfExists('article_slugs'); + Schema::dropIfExists('articles'); + } +} diff --git a/resources/views/admin/adCampaigns/form.blade.php b/resources/views/admin/adCampaigns/form.blade.php new file mode 100644 index 0000000..9868a29 --- /dev/null +++ b/resources/views/admin/adCampaigns/form.blade.php @@ -0,0 +1,23 @@ +@extends('twill::layouts.form') + +@section('contentFields') + @formField('input', [ + 'name' => 'organization', + 'label' => 'Entreprise', + 'maxlength' => 100 + ]) + @formField('wysiwyg', [ + 'name' => 'description', + 'label' => 'Description', + 'maxlength' => 400 + ]) + @formField('input', [ + 'name' => 'url', + 'label' => 'Lien', + 'maxlength' => 255 + ]) + @formField('medias', [ + 'name' => 'image', + 'label' => 'Image', + ]) +@stop diff --git a/resources/views/admin/articles/form.blade.php b/resources/views/admin/articles/form.blade.php new file mode 100644 index 0000000..2dd200d --- /dev/null +++ b/resources/views/admin/articles/form.blade.php @@ -0,0 +1,12 @@ +@extends('twill::layouts.form') + +@section('contentFields') + @formField('input', [ + 'name' => 'description', + 'label' => 'Description', + 'maxlength' => 400 + ]) + @formField('block_editor', [ + 'blocks' => ['title', 'quote', 'text', 'image', 'grid', 'test', 'publications', 'news'] + ]) +@stop diff --git a/resources/views/admin/events/form.blade.php b/resources/views/admin/events/form.blade.php new file mode 100644 index 0000000..d5138ba --- /dev/null +++ b/resources/views/admin/events/form.blade.php @@ -0,0 +1,32 @@ +@extends('twill::layouts.form') + +@section('contentFields') + @formField('date_picker', [ + 'name' => 'start_date', + 'label' => 'Date de début', + ]) + @formField('date_picker', [ + 'name' => 'end_date', + 'label' => 'Date de fin', + ]) + @formField('input', [ + 'name' => 'organization', + 'label' => 'Entreprise', + 'maxlength' => 100 + ]) + @formField('wysiwyg', [ + 'name' => 'description', + 'label' => 'Description', + 'maxlength' => 400 + ]) + @formField('input', [ + 'name' => 'url', + 'label' => 'Lien', + 'maxlength' => 255 + ]) + @formField('medias', [ + 'name' => 'image', + 'label' => 'Image', + ]) + +@stop diff --git a/routes/admin.php b/routes/admin.php index ebe1c52..6a2fb05 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -1,4 +1,6 @@ true]); - +Route::get('/images/{path}', 'ImageController@show')->where('path', '.*'); /** ADMIN ROUTES */