diff --git a/README.md b/README.md index 5072b878..16e1cfee 100755 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ## Introduction * This is a laravel Admin Panel, based on [Rappasoft Laravel Boilerplate](https://github.com/rappasoft/laravel-5-boilerplate/releases/tag/4.5.7), with enhancemenets and many modules pre-made, just for you. -* The project is taken to Laravel 5.5 so we can develop from the latest Laravel. +* The project is taken to Laravel 5.6 so we can develop from the latest Laravel. ## Features For Laravel 5 Boilerplate Features : [Features](https://github.com/rappasoft/laravel-5-boilerplate/wiki#features) @@ -29,7 +29,7 @@ It gives you the ability to create a module using a sweet GUI, where you put in ## Installation -Please check the official laravel installation guide for server requirements before you start. [Official Documentation](https://laravel.com/docs/5.4/installation#installation) +Please check the official laravel installation guide for server requirements before you start. [Official Documentation](https://laravel.com/docs/5.6/installation#installation) Clone the repository diff --git a/app/Http/Controllers/Api/V1/PagesController.php b/app/Http/Controllers/Api/V1/PagesController.php index a3283afe..08ddf3e7 100644 --- a/app/Http/Controllers/Api/V1/PagesController.php +++ b/app/Http/Controllers/Api/V1/PagesController.php @@ -62,9 +62,9 @@ public function store(Request $request) return $this->throwValidation($validation->messages()->first()); } - $this->repository->create($request->all()); + $page = $this->repository->create($request->all()); - return new PagesResource(Page::orderBy('created_at', 'desc')->first()); + return new PagesResource($page); } /** diff --git a/app/Http/Controllers/Api/V1/UsersController.php b/app/Http/Controllers/Api/V1/UsersController.php index bc9cda18..141e1149 100644 --- a/app/Http/Controllers/Api/V1/UsersController.php +++ b/app/Http/Controllers/Api/V1/UsersController.php @@ -2,7 +2,6 @@ namespace App\Http\Controllers\Api\V1; -use App\Http\Requests\Backend\Access\User\ManageUserRequest; use App\Http\Resources\UserResource; use App\Models\Access\User\User; use App\Repositories\Backend\Access\User\UserRepository; @@ -30,7 +29,7 @@ public function __construct(UserRepository $repository) * * @return \Illuminate\Http\JsonResponse */ - public function index(ManageUserRequest $request) + public function index(Request $request) { $limit = $request->get('paginate') ? $request->get('paginate') : 25; diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index a2c35414..6974409f 100755 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -12,6 +12,6 @@ class VerifyCsrfToken extends BaseVerifier * @var array */ protected $except = [ - // + 'api/*', ]; } diff --git a/app/Repositories/Backend/Pages/PagesRepository.php b/app/Repositories/Backend/Pages/PagesRepository.php index 73e2803e..42190754 100644 --- a/app/Repositories/Backend/Pages/PagesRepository.php +++ b/app/Repositories/Backend/Pages/PagesRepository.php @@ -58,7 +58,7 @@ public function create(array $input) if ($page = Page::create($input)) { event(new PageCreated($page)); - return true; + return $page; } throw new GeneralException(trans('exceptions.backend.pages.create_error')); diff --git a/composer.json b/composer.json index 51f95969..236ac343 100755 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "laravel/socialite": "^3.0", "laravel/tinker": "~1.0", "laravelcollective/html": "^5.4.0", - "spatie/laravel-cors": "^1.1", + "spatie/laravel-cors": "^1.2", "tymon/jwt-auth": "dev-develop", "unisharp/laravel-filemanager": "~1.8", "yajra/laravel-datatables-oracle": "~8.0" diff --git a/composer.lock b/composer.lock index c66788ca..a4b41187 100755 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "cda8a083b7461c2abcd24181fa94e165", + "content-hash": "47881206fa716e06d6d48b9a4881de4e", "packages": [ { "name": "arcanedev/log-viewer", @@ -195,16 +195,16 @@ }, { "name": "creativeorange/gravatar", - "version": "1.0.10", + "version": "v1.0.11", "source": { "type": "git", "url": "https://github.com/creativeorange/gravatar.git", - "reference": "9affd46be10f1ebb11d5d9f03440f804c09f2b59" + "reference": "4459b68a853ffdb1c2abbf9419214df46371889b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/creativeorange/gravatar/zipball/9affd46be10f1ebb11d5d9f03440f804c09f2b59", - "reference": "9affd46be10f1ebb11d5d9f03440f804c09f2b59", + "url": "https://api.github.com/repos/creativeorange/gravatar/zipball/4459b68a853ffdb1c2abbf9419214df46371889b", + "reference": "4459b68a853ffdb1c2abbf9419214df46371889b", "shasum": "" }, "require": { @@ -212,6 +212,16 @@ "php": ">=5.4.0" }, "type": "library", + "extra": { + "laravel": { + "providers": [ + "Creativeorange\\Gravatar\\GravatarServiceProvider" + ], + "aliases": { + "Gravatar": "Creativeorange\\Gravatar\\Facades\\Gravatar" + } + } + }, "autoload": { "psr-4": { "Creativeorange\\Gravatar\\": "src/" @@ -229,13 +239,13 @@ "role": "Developer" } ], - "description": "A Laravel 5.0, 5.1, 5.2 and 5.3 gravatar package for retrieving gravatar image URLs or checking the existance of an image.", + "description": "Gravatar for Laravel 5.0.x through 5.5.x package for retrieving gravatar image URLs or checking the existance of an image.", "keywords": [ "avatar", "gravatar", "laravel" ], - "time": "2017-02-15T22:07:40+00:00" + "time": "2018-03-29T22:10:58+00:00" }, { "name": "davejamesmiller/laravel-breadcrumbs", @@ -613,16 +623,16 @@ }, { "name": "doctrine/dbal", - "version": "v2.6.3", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "e3eed9b1facbb0ced3a0995244843a189e7d1b13" + "reference": "f76bf5ef631cec551a86c2291fc749534febebf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/e3eed9b1facbb0ced3a0995244843a189e7d1b13", - "reference": "e3eed9b1facbb0ced3a0995244843a189e7d1b13", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/f76bf5ef631cec551a86c2291fc749534febebf1", + "reference": "f76bf5ef631cec551a86c2291fc749534febebf1", "shasum": "" }, "require": { @@ -631,9 +641,11 @@ "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^5.4.6", + "doctrine/coding-standard": "^4.0", + "phpunit/phpunit": "^7.0", "phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5", - "symfony/console": "2.*||^3.0" + "symfony/console": "^2.0.5||^3.0", + "symfony/phpunit-bridge": "^3.4.5|^4.0.5" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -644,7 +656,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6.x-dev" + "dev-master": "2.7.x-dev" } }, "autoload": { @@ -682,7 +694,7 @@ "persistence", "queryobject" ], - "time": "2017-11-19T13:38:54+00:00" + "time": "2018-04-01T23:33:17+00:00" }, { "name": "doctrine/inflector", @@ -1013,16 +1025,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.3.0", + "version": "6.3.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/68d0ea14d5a3f42a20e87632a5f84931e2709c90", + "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90", "shasum": "" }, "require": { @@ -1032,7 +1044,7 @@ }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4", "psr/log": "^1.0" }, "suggest": { @@ -1041,7 +1053,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2-dev" + "dev-master": "6.3-dev" } }, "autoload": { @@ -1074,7 +1086,7 @@ "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" + "time": "2018-03-26T16:33:04+00:00" }, { "name": "guzzlehttp/promises", @@ -1414,16 +1426,16 @@ }, { "name": "laravel/framework", - "version": "v5.6.12", + "version": "v5.6.15", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "82d8165d1ea86bdd81ddfa1db9343fa19e7d1450" + "reference": "baa42cf6bdd942523fafece21ec16a1843c6db0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/82d8165d1ea86bdd81ddfa1db9343fa19e7d1450", - "reference": "82d8165d1ea86bdd81ddfa1db9343fa19e7d1450", + "url": "https://api.github.com/repos/laravel/framework/zipball/baa42cf6bdd942523fafece21ec16a1843c6db0f", + "reference": "baa42cf6bdd942523fafece21ec16a1843c6db0f", "shasum": "" }, "require": { @@ -1548,7 +1560,7 @@ "framework", "laravel" ], - "time": "2018-03-14T17:29:38+00:00" + "time": "2018-03-30T13:29:58+00:00" }, { "name": "laravel/socialite", @@ -1677,16 +1689,16 @@ }, { "name": "laravelcollective/html", - "version": "v5.6.3", + "version": "v5.6.5", "source": { "type": "git", "url": "https://github.com/LaravelCollective/html.git", - "reference": "41cd9291a69bd24f2184e504be041348a87308a8" + "reference": "623a150c91e2d3f92eeee9f9eda58a841e3cb548" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LaravelCollective/html/zipball/41cd9291a69bd24f2184e504be041348a87308a8", - "reference": "41cd9291a69bd24f2184e504be041348a87308a8", + "url": "https://api.github.com/repos/LaravelCollective/html/zipball/623a150c91e2d3f92eeee9f9eda58a841e3cb548", + "reference": "623a150c91e2d3f92eeee9f9eda58a841e3cb548", "shasum": "" }, "require": { @@ -1741,7 +1753,7 @@ ], "description": "HTML and Form Builders for the Laravel Framework", "homepage": "https://laravelcollective.com", - "time": "2018-02-12T14:19:42+00:00" + "time": "2018-03-16T16:57:31+00:00" }, { "name": "lcobucci/jwt", @@ -2091,16 +2103,16 @@ }, { "name": "nesbot/carbon", - "version": "1.24.2", + "version": "1.25.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "bba6c6e410c6b4317e37a9474aeaa753808c3875" + "reference": "cbcf13da0b531767e39eb86e9687f5deba9857b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bba6c6e410c6b4317e37a9474aeaa753808c3875", - "reference": "bba6c6e410c6b4317e37a9474aeaa753808c3875", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/cbcf13da0b531767e39eb86e9687f5deba9857b4", + "reference": "cbcf13da0b531767e39eb86e9687f5deba9857b4", "shasum": "" }, "require": { @@ -2140,7 +2152,7 @@ "datetime", "time" ], - "time": "2018-03-10T10:10:14+00:00" + "time": "2018-03-19T15:50:49+00:00" }, { "name": "nikic/php-parser", @@ -2437,16 +2449,16 @@ }, { "name": "psy/psysh", - "version": "v0.8.17", + "version": "v0.8.18", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "5069b70e8c4ea492c2b5939b6eddc78bfe41cfec" + "reference": "5357b1cffc8fb375d6a9e3c86d5c82dd38a40834" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/5069b70e8c4ea492c2b5939b6eddc78bfe41cfec", - "reference": "5069b70e8c4ea492c2b5939b6eddc78bfe41cfec", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/5357b1cffc8fb375d6a9e3c86d5c82dd38a40834", + "reference": "5357b1cffc8fb375d6a9e3c86d5c82dd38a40834", "shasum": "" }, "require": { @@ -2505,7 +2517,7 @@ "interactive", "shell" ], - "time": "2017-12-28T16:14:16+00:00" + "time": "2018-04-02T05:41:44+00:00" }, { "name": "ramsey/uuid", @@ -2589,16 +2601,16 @@ }, { "name": "spatie/laravel-cors", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-cors.git", - "reference": "7e5fa8db4b57e3f8026dd7df9ebdf4ca9086e4e9" + "reference": "98893ca6eb773f587dfb4e2745dbfabd21fafd27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-cors/zipball/7e5fa8db4b57e3f8026dd7df9ebdf4ca9086e4e9", - "reference": "7e5fa8db4b57e3f8026dd7df9ebdf4ca9086e4e9", + "url": "https://api.github.com/repos/spatie/laravel-cors/zipball/98893ca6eb773f587dfb4e2745dbfabd21fafd27", + "reference": "98893ca6eb773f587dfb4e2745dbfabd21fafd27", "shasum": "" }, "require": { @@ -2644,7 +2656,7 @@ "request", "spatie" ], - "time": "2018-03-09T20:14:04+00:00" + "time": "2018-03-30T07:39:12+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -2703,16 +2715,16 @@ }, { "name": "symfony/console", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51" + "reference": "aad9a6fe47319f22748fd764f52d3a7ca6fa6b64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/555c8dbe0ae9e561740451eabdbed2cc554b6a51", - "reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51", + "url": "https://api.github.com/repos/symfony/console/zipball/aad9a6fe47319f22748fd764f52d3a7ca6fa6b64", + "reference": "aad9a6fe47319f22748fd764f52d3a7ca6fa6b64", "shasum": "" }, "require": { @@ -2767,20 +2779,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-02-26T15:55:47+00:00" + "time": "2018-04-03T05:24:00+00:00" }, { "name": "symfony/css-selector", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "c69f1e93aa898fd9fec627ebef467188151c8dc2" + "reference": "03f965583147957f1ecbad7ea1c9d6fd5e525ec2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/c69f1e93aa898fd9fec627ebef467188151c8dc2", - "reference": "c69f1e93aa898fd9fec627ebef467188151c8dc2", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/03f965583147957f1ecbad7ea1c9d6fd5e525ec2", + "reference": "03f965583147957f1ecbad7ea1c9d6fd5e525ec2", "shasum": "" }, "require": { @@ -2820,20 +2832,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-02-03T14:58:37+00:00" + "time": "2018-03-19T22:35:49+00:00" }, { "name": "symfony/debug", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "1721e4e7effb23480966690cdcdc7d2a4152d489" + "reference": "5961d02d48828671f5d8a7805e06579d692f6ede" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/1721e4e7effb23480966690cdcdc7d2a4152d489", - "reference": "1721e4e7effb23480966690cdcdc7d2a4152d489", + "url": "https://api.github.com/repos/symfony/debug/zipball/5961d02d48828671f5d8a7805e06579d692f6ede", + "reference": "5961d02d48828671f5d8a7805e06579d692f6ede", "shasum": "" }, "require": { @@ -2876,11 +2888,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-02-28T21:50:02+00:00" + "time": "2018-04-03T05:24:00+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2943,16 +2955,16 @@ }, { "name": "symfony/finder", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "44a796d2ecc2a16a5fc8f2956a34ee617934d55f" + "reference": "c72995d9f5999b3fcdd8660c0c9690243252e1e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/44a796d2ecc2a16a5fc8f2956a34ee617934d55f", - "reference": "44a796d2ecc2a16a5fc8f2956a34ee617934d55f", + "url": "https://api.github.com/repos/symfony/finder/zipball/c72995d9f5999b3fcdd8660c0c9690243252e1e1", + "reference": "c72995d9f5999b3fcdd8660c0c9690243252e1e1", "shasum": "" }, "require": { @@ -2988,20 +3000,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-03-05T18:28:26+00:00" + "time": "2018-04-02T09:52:41+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "6c181e81a3a9a7996c62ebd7803592536e729c5a" + "reference": "d0864a82e5891ab61d31eecbaa48bed5a09b8e6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/6c181e81a3a9a7996c62ebd7803592536e729c5a", - "reference": "6c181e81a3a9a7996c62ebd7803592536e729c5a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d0864a82e5891ab61d31eecbaa48bed5a09b8e6c", + "reference": "d0864a82e5891ab61d31eecbaa48bed5a09b8e6c", "shasum": "" }, "require": { @@ -3041,20 +3053,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-03-05T16:01:10+00:00" + "time": "2018-04-03T05:24:00+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "2a1ebfe8c37240500befcb17bceb3893adacffa3" + "reference": "38337d03a554a2b0e9f553d368723692b7c04a8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/2a1ebfe8c37240500befcb17bceb3893adacffa3", - "reference": "2a1ebfe8c37240500befcb17bceb3893adacffa3", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/38337d03a554a2b0e9f553d368723692b7c04a8f", + "reference": "38337d03a554a2b0e9f553d368723692b7c04a8f", "shasum": "" }, "require": { @@ -3127,7 +3139,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2018-03-05T22:27:01+00:00" + "time": "2018-04-03T06:20:33+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3353,16 +3365,16 @@ }, { "name": "symfony/process", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "6ed08502a7c9559da8e60ea343bdbd19c3350b3e" + "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/6ed08502a7c9559da8e60ea343bdbd19c3350b3e", - "reference": "6ed08502a7c9559da8e60ea343bdbd19c3350b3e", + "url": "https://api.github.com/repos/symfony/process/zipball/d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25", + "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25", "shasum": "" }, "require": { @@ -3398,20 +3410,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-02-19T12:18:43+00:00" + "time": "2018-04-03T05:24:00+00:00" }, { "name": "symfony/routing", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "9c6268c1970c7e507bedc8946bece32a7db23515" + "reference": "ca780c838046bfef4a6fd50284ae71a5d1f1a8b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/9c6268c1970c7e507bedc8946bece32a7db23515", - "reference": "9c6268c1970c7e507bedc8946bece32a7db23515", + "url": "https://api.github.com/repos/symfony/routing/zipball/ca780c838046bfef4a6fd50284ae71a5d1f1a8b2", + "reference": "ca780c838046bfef4a6fd50284ae71a5d1f1a8b2", "shasum": "" }, "require": { @@ -3476,11 +3488,11 @@ "uri", "url" ], - "time": "2018-02-28T21:50:02+00:00" + "time": "2018-04-02T09:52:41+00:00" }, { "name": "symfony/translation", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -3548,16 +3560,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c7d89044ed6ed3b7d8b558d509cca0666b947e58" + "reference": "f9b257f2009c7f09166bcfd3d3d96455741ed371" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c7d89044ed6ed3b7d8b558d509cca0666b947e58", - "reference": "c7d89044ed6ed3b7d8b558d509cca0666b947e58", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f9b257f2009c7f09166bcfd3d3d96455741ed371", + "reference": "f9b257f2009c7f09166bcfd3d3d96455741ed371", "shasum": "" }, "require": { @@ -3613,7 +3625,7 @@ "debug", "dump" ], - "time": "2018-02-26T15:55:47+00:00" + "time": "2018-04-03T05:24:00+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -3863,16 +3875,16 @@ }, { "name": "yajra/laravel-datatables-oracle", - "version": "v8.4.1", + "version": "v8.4.2", "source": { "type": "git", "url": "https://github.com/yajra/laravel-datatables.git", - "reference": "cb052ed2608c266b1f942e1f845b8275696cd798" + "reference": "eab6cc583ae778d056c5caf21b70db803d956e14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/cb052ed2608c266b1f942e1f845b8275696cd798", - "reference": "cb052ed2608c266b1f942e1f845b8275696cd798", + "url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/eab6cc583ae778d056c5caf21b70db803d956e14", + "reference": "eab6cc583ae778d056c5caf21b70db803d956e14", "shasum": "" }, "require": { @@ -3888,6 +3900,7 @@ }, "suggest": { "yajra/laravel-datatables-buttons": "Plugin for server-side exporting of dataTable.", + "yajra/laravel-datatables-editor": "Plugin to use Datatables Editor (requires a license).", "yajra/laravel-datatables-fractal": "Plugin for server-side response using Fractal.", "yajra/laravel-datatables-html": "Plugin for server-side HTML builder of dataTable." }, @@ -3929,7 +3942,7 @@ "jquery", "laravel" ], - "time": "2018-02-16T08:22:10+00:00" + "time": "2018-03-28T16:31:13+00:00" } ], "packages-dev": [ @@ -5137,16 +5150,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.0.2", + "version": "7.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e2f8aa21bc54b6ba218bdd4f9e0dac1e9bc3b4e9" + "reference": "536f4d853c12d8189963435088e8ff7c0daeab2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e2f8aa21bc54b6ba218bdd4f9e0dac1e9bc3b4e9", - "reference": "e2f8aa21bc54b6ba218bdd4f9e0dac1e9bc3b4e9", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/536f4d853c12d8189963435088e8ff7c0daeab2e", + "reference": "536f4d853c12d8189963435088e8ff7c0daeab2e", "shasum": "" }, "require": { @@ -5160,7 +5173,7 @@ "phar-io/version": "^1.0", "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0", + "phpunit/php-code-coverage": "^6.0.1", "phpunit/php-file-iterator": "^1.4.3", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.0", @@ -5213,7 +5226,7 @@ "testing", "xunit" ], - "time": "2018-02-26T07:03:12+00:00" + "time": "2018-03-26T07:36:48+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -5836,16 +5849,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "26726ddc01601dc9393f2afc3369ce1ca64e4537" + "reference": "d6c04c7532535b5e0b63db45b543cd60818e0fbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/26726ddc01601dc9393f2afc3369ce1ca64e4537", - "reference": "26726ddc01601dc9393f2afc3369ce1ca64e4537", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d6c04c7532535b5e0b63db45b543cd60818e0fbc", + "reference": "d6c04c7532535b5e0b63db45b543cd60818e0fbc", "shasum": "" }, "require": { @@ -5888,20 +5901,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-02-22T10:50:29+00:00" + "time": "2018-03-19T22:35:49+00:00" }, { "name": "symfony/yaml", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "de5f125ea39de846b90b313b2cfb031a0152d223" + "reference": "8b34ebb5989df61cbd77eff29a02c4db9ac1069c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/de5f125ea39de846b90b313b2cfb031a0152d223", - "reference": "de5f125ea39de846b90b313b2cfb031a0152d223", + "url": "https://api.github.com/repos/symfony/yaml/zipball/8b34ebb5989df61cbd77eff29a02c4db9ac1069c", + "reference": "8b34ebb5989df61cbd77eff29a02c4db9ac1069c", "shasum": "" }, "require": { @@ -5946,7 +5959,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-02-19T20:08:53+00:00" + "time": "2018-04-03T05:24:00+00:00" }, { "name": "theseer/tokenizer", diff --git a/config/cors.php b/config/cors.php index 63bc25e5..dabc6809 100644 --- a/config/cors.php +++ b/config/cors.php @@ -39,6 +39,15 @@ 'Authorization', ], + 'expose_headers' => [ + 'Cache-Control', + 'Content-Language', + 'Content-Type', + 'Expires', + 'Last-Modified', + 'Pragma', + ], + 'forbidden_response' => [ 'message' => 'Forbidden (cors).', 'status' => 403, diff --git a/database/factories/PageFactory.php b/database/factories/PageFactory.php index 8730f837..a18bee47 100644 --- a/database/factories/PageFactory.php +++ b/database/factories/PageFactory.php @@ -7,12 +7,18 @@ $factory->define(Page::class, function (Faker $faker) { $title = $faker->sentence; + $newestPage = Page::orderBy('id', 'desc')->first(); + return [ - 'title' => $title, - 'page_slug' => str_slug($title), - 'description' => $faker->paragraph, - 'created_by' => function () { + 'title' => $title, + 'page_slug' => str_slug($title), + 'description' => $faker->paragraph, + 'cannonical_link' => 'http://localhost:8000/'.str_slug($title), + 'created_by' => function () { return factory(User::class)->create()->id; }, + 'status' => 1, + 'created_at' => Carbon\Carbon::now(), + 'updated_at' => Carbon\Carbon::now(), ]; }); diff --git a/public/js/backend/admin.js b/public/js/backend/admin.js index b4d1ba96..f8ead911 100755 --- a/public/js/backend/admin.js +++ b/public/js/backend/admin.js @@ -370,7 +370,7 @@ var Backend = {}; // common variable used in all the files of the backend if (request.status >= 200 && request.status < 400) { // Success! response = request.responseText; - Backend.Blog.selectors.slug.value = Backend.Blog.selectors.SlugUrl + '/' + response; + Backend.Blog.selectors.slug.value = Backend.Blog.selectors.SlugUrl + '/' + response.trim(); } }, error: function (request) { diff --git a/tests/Feature/Api/V1/PageTest.php b/tests/Feature/Api/V1/PageTest.php new file mode 100644 index 00000000..a2e0fc06 --- /dev/null +++ b/tests/Feature/Api/V1/PageTest.php @@ -0,0 +1,179 @@ +user = User::find(1); + + $this->token = JWTAuth::fromUser($this->user); + $this->headers = ['Authorization' => 'Bearer '.$this->token]; + } + + /** + * A basic test example. + * + * @return void + */ + public function testExample() + { + $this->assertTrue(true); + } + + /** + * A basic test to get response form pages api. + * + * @return void + */ + + /** @test */ + public function Get_records_from_pages() + { + $payload = []; + $response = $this->json('GET', '/api/v1/pages', $payload, $this->headers); + $response + ->assertStatus(200) + ->assertJsonStructure([ + 'data'=> [ + [ + 'id', + 'title', + 'status_label', + 'status', + 'created_at', + 'created_by', + ], + ], + 'links', + 'meta', + ]); + } + + /** + * A basic test to get response form pages api. + * + * @return void + */ + + /** @test */ + public function get_one_created_page_from_db() + { + $page = create(Page::class); + $payload = []; + $response = $this->json('GET', '/api/v1/pages/'.$page->id, $payload, $this->headers); + $response + ->assertStatus(200) + ->assertJson([ + 'data'=> [ + 'id' => $page->id, + 'title' => $page->title, + 'status_label' => $page->status_label, + 'status' => ($page->isActive()) ? 'Active' : 'InActive', + 'created_by' => $page->created_by, + ], + ]); + } + + /** + * Author: Indra Shastri + * Date:03-03-2018 + * A basic test to update a page from api. + * + * + * @return void + */ + + /** @test */ + public function update_a_page_in_db_and_get_response() + { + $page = make(Page::class); + $payload = [ + 'title' => $page->title, + 'description' => $page->description, + 'cannonical_link' => $page->cannonical_link, + 'seo_title' => 'some tittle', + 'seo_keyword' => 'some keywords', + 'seo_description' => '

 

SEO Description

some seco desctription

askdsaj;ldsjfd

', + 'status' => '1', + ]; + $response = ''; + $response = $this->json('PUT', '/api/v1/pages/1', $payload, $this->headers); + + $response->assertStatus(200); + $response->assertJson([ + 'data'=> [ + 'title' => $page->title, + 'status_label' => $page->status_label, + 'status' => ($page->isActive()) ? 'Active' : 'InActive', + 'created_by' => ''.$this->user->id, + ], + ]); + } + + /** + * Author: Indra Shastri + * Date:03-03-2018 + * A basic test to create a page from api. + * + * @return void + */ + + /** @test */ + public function create_a_new_page_in_db_and_get_response() + { + $page = make(Page::class); + $payload = [ + 'title' => $page->title, + 'description' => $page->description, + 'cannonical_link' => $page->cannonical_link, + 'seo_title' => 'some tittle', + 'seo_keyword' => 'some keywords', + 'seo_description' => '

 

SEO Description

some seco desctription

askdsaj;ldsjfd

', + 'status' => '1', + ]; + $response = ''; + $response = $this->json('POST', '/api/v1/pages', $payload, $this->headers); + $response->assertStatus(201); + $response->assertJson([ + 'data' => [ + 'title' => $page->title, + 'status_label' => $page->status_label, + 'status' => ($page->isActive()) ? 'Active' : 'InActive', + 'created_by' => $this->user->first_name, + 'created_at' => (\Carbon\Carbon::now())->toDateString(), + ], + ]); + } + + /** + * Author: Indra Shastri + * Date:03-03-2018 + * A basic test to create a page from api. + * + * @return void + */ + + /** @test */ + public function delete_page_in_db_and_get_response() + { + $page = create(Page::class); + $payload = []; + $response = $this->json('DELETE', '/api/v1/pages/'.$page->id, $payload, $this->headers); + $response->assertStatus(200) + ->assertJson([ + 'message'=> 'The Page was successfully deleted.', + ]); + } +}