diff --git a/app/Http/Controllers/Blog.php b/app/Http/Controllers/Blog.php index 6fe7f6c4..db20ad95 100644 --- a/app/Http/Controllers/Blog.php +++ b/app/Http/Controllers/Blog.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Models\Response; use Illuminate\Http\Request; use Str; @@ -140,4 +141,22 @@ public function disableReplies($slug) //POST ); return redirect(route('blog.hidden')); } + + public function response($slug, Request $request) // POST REQUEST + { + $id = \App\Models\Blog::query() + ->where('slug', $slug) + ->first()->id; + + Response::query() + ->create( + [ + 'user_id' => auth()->id(), + 'blog_id' => $id, + 'response' => $request->input('comment') + ] + ); + + return redirect(route('blog.show', $slug)); + } } diff --git a/app/Models/Blog.php b/app/Models/Blog.php index f5e182d8..2ccf3ec7 100644 --- a/app/Models/Blog.php +++ b/app/Models/Blog.php @@ -24,4 +24,9 @@ public function User() { return $this->belongsTo(User::class); } + + public function Response() + { + return $this->hasMany(Response::class); + } } diff --git a/app/Models/Response.php b/app/Models/Response.php new file mode 100644 index 00000000..ffa02f52 --- /dev/null +++ b/app/Models/Response.php @@ -0,0 +1,27 @@ +belongsTo(Blog::class); + } + + public function User() + { + return $this->belongsTo(User::class); + } +} diff --git a/composer.lock b/composer.lock index 306e05a9..7f7c04cb 100644 --- a/composer.lock +++ b/composer.lock @@ -114,16 +114,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.231.13", + "version": "3.231.16", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "7bff685fea578276c28d5476197f6c3fa7cff116" + "reference": "c50adea1de4ad3d6dda41310a8af5ce13ee876d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7bff685fea578276c28d5476197f6c3fa7cff116", - "reference": "7bff685fea578276c28d5476197f6c3fa7cff116", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c50adea1de4ad3d6dda41310a8af5ce13ee876d5", + "reference": "c50adea1de4ad3d6dda41310a8af5ce13ee876d5", "shasum": "" }, "require": { @@ -200,9 +200,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.231.13" + "source": "https://github.com/aws/aws-sdk-php/tree/3.231.16" }, - "time": "2022-07-25T18:21:23+00:00" + "time": "2022-07-28T18:17:24+00:00" }, { "name": "bacon/bacon-qr-code", @@ -1540,16 +1540,16 @@ }, { "name": "laravel/framework", - "version": "v9.22.0", + "version": "v9.22.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "b30095050b9409669a38cd0fee3c3a273266277e" + "reference": "b3b3dd43b9899f23df6d1d3e5390bd4662947a46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/b30095050b9409669a38cd0fee3c3a273266277e", - "reference": "b30095050b9409669a38cd0fee3c3a273266277e", + "url": "https://api.github.com/repos/laravel/framework/zipball/b3b3dd43b9899f23df6d1d3e5390bd4662947a46", + "reference": "b3b3dd43b9899f23df6d1d3e5390bd4662947a46", "shasum": "" }, "require": { @@ -1716,7 +1716,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-07-26T13:30:21+00:00" + "time": "2022-07-26T16:16:33+00:00" }, { "name": "laravel/sanctum", @@ -1916,28 +1916,28 @@ }, { "name": "laravel/socialite", - "version": "v5.5.2", + "version": "v5.5.3", "source": { "type": "git", "url": "https://github.com/laravel/socialite.git", - "reference": "68afb03259b82d898c68196cbcacd48596a9dd72" + "reference": "9dfc76b31ee041c45a7cae86f23339784abde46d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/socialite/zipball/68afb03259b82d898c68196cbcacd48596a9dd72", - "reference": "68afb03259b82d898c68196cbcacd48596a9dd72", + "url": "https://api.github.com/repos/laravel/socialite/zipball/9dfc76b31ee041c45a7cae86f23339784abde46d", + "reference": "9dfc76b31ee041c45a7cae86f23339784abde46d", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/guzzle": "^6.0|^7.0", + "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0", "illuminate/http": "^6.0|^7.0|^8.0|^9.0", "illuminate/support": "^6.0|^7.0|^8.0|^9.0", - "league/oauth1-client": "^1.0", + "league/oauth1-client": "^1.10.1", "php": "^7.2|^8.0" }, "require-dev": { - "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0", "mockery/mockery": "^1.0", "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0", "phpunit/phpunit": "^8.0|^9.3" @@ -1981,7 +1981,7 @@ "issues": "https://github.com/laravel/socialite/issues", "source": "https://github.com/laravel/socialite" }, - "time": "2022-03-10T15:26:19+00:00" + "time": "2022-07-18T13:51:19+00:00" }, { "name": "laravel/telescope", @@ -2260,16 +2260,16 @@ }, { "name": "league/commonmark", - "version": "2.3.4", + "version": "2.3.5", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "155ec1c95626b16fda0889cf15904d24890a60d5" + "reference": "84d74485fdb7074f4f9dd6f02ab957b1de513257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/155ec1c95626b16fda0889cf15904d24890a60d5", - "reference": "155ec1c95626b16fda0889cf15904d24890a60d5", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/84d74485fdb7074f4f9dd6f02ab957b1de513257", + "reference": "84d74485fdb7074f4f9dd6f02ab957b1de513257", "shasum": "" }, "require": { @@ -2291,13 +2291,13 @@ "github/gfm": "0.29.0", "michelf/php-markdown": "^1.4", "nyholm/psr7": "^1.5", - "phpstan/phpstan": "^0.12.88 || ^1.0.0", - "phpunit/phpunit": "^9.5.5", + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.21", "scrutinizer/ocular": "^1.8.1", - "symfony/finder": "^5.3", + "symfony/finder": "^5.3 | ^6.0", "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0", - "unleashedtech/php-coding-standard": "^3.1", - "vimeo/psalm": "^4.7.3" + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0" }, "suggest": { "symfony/yaml": "v2.3+ required if using the Front Matter extension" @@ -2362,7 +2362,7 @@ "type": "tidelift" } ], - "time": "2022-07-17T16:25:47+00:00" + "time": "2022-07-29T10:59:45+00:00" }, { "name": "league/config", @@ -3133,16 +3133,16 @@ }, { "name": "nesbot/carbon", - "version": "2.59.1", + "version": "2.60.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "a9000603ea337c8df16cc41f8b6be95a65f4d0f5" + "reference": "00a259ae02b003c563158b54fb6743252b638ea6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/a9000603ea337c8df16cc41f8b6be95a65f4d0f5", - "reference": "a9000603ea337c8df16cc41f8b6be95a65f4d0f5", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/00a259ae02b003c563158b54fb6743252b638ea6", + "reference": "00a259ae02b003c563158b54fb6743252b638ea6", "shasum": "" }, "require": { @@ -3231,7 +3231,7 @@ "type": "tidelift" } ], - "time": "2022-06-29T21:43:55+00:00" + "time": "2022-07-27T15:57:48+00:00" }, { "name": "nette/schema", @@ -4299,16 +4299,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.7", + "version": "v0.11.8", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "77fc7270031fbc28f9a7bea31385da5c4855cb7a" + "reference": "f455acf3645262ae389b10e9beba0c358aa6994e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/77fc7270031fbc28f9a7bea31385da5c4855cb7a", - "reference": "77fc7270031fbc28f9a7bea31385da5c4855cb7a", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/f455acf3645262ae389b10e9beba0c358aa6994e", + "reference": "f455acf3645262ae389b10e9beba0c358aa6994e", "shasum": "" }, "require": { @@ -4369,9 +4369,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.7" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.8" }, - "time": "2022-07-07T13:49:11+00:00" + "time": "2022-07-28T14:25:11+00:00" }, { "name": "ralouphie/getallheaders", @@ -4761,16 +4761,16 @@ }, { "name": "symfony/console", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7" + "reference": "43fcb5c5966b43c56bcfa481368d90d748936ab8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7a86c1c42fbcb69b59768504c7bca1d3767760b7", - "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7", + "url": "https://api.github.com/repos/symfony/console/zipball/43fcb5c5966b43c56bcfa481368d90d748936ab8", + "reference": "43fcb5c5966b43c56bcfa481368d90d748936ab8", "shasum": "" }, "require": { @@ -4837,7 +4837,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.2" + "source": "https://github.com/symfony/console/tree/v6.1.3" }, "funding": [ { @@ -4853,20 +4853,20 @@ "type": "tidelift" } ], - "time": "2022-06-26T13:01:30+00:00" + "time": "2022-07-22T14:17:57+00:00" }, { "name": "symfony/css-selector", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "05c40f02f621609404b8820ff8bc39acb46e19cf" + "reference": "0dd5e36b80e1de97f8f74ed7023ac2b837a36443" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/05c40f02f621609404b8820ff8bc39acb46e19cf", - "reference": "05c40f02f621609404b8820ff8bc39acb46e19cf", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/0dd5e36b80e1de97f8f74ed7023ac2b837a36443", + "reference": "0dd5e36b80e1de97f8f74ed7023ac2b837a36443", "shasum": "" }, "require": { @@ -4902,7 +4902,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.1.0" + "source": "https://github.com/symfony/css-selector/tree/v6.1.3" }, "funding": [ { @@ -4918,7 +4918,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-06-27T17:24:16+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4989,16 +4989,16 @@ }, { "name": "symfony/error-handler", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "d02c662651e5de760bb7d5e94437113309e8f8a0" + "reference": "736e42db3fd586d91820355988698e434e1d8419" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/d02c662651e5de760bb7d5e94437113309e8f8a0", - "reference": "d02c662651e5de760bb7d5e94437113309e8f8a0", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/736e42db3fd586d91820355988698e434e1d8419", + "reference": "736e42db3fd586d91820355988698e434e1d8419", "shasum": "" }, "require": { @@ -5040,7 +5040,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.1.0" + "source": "https://github.com/symfony/error-handler/tree/v6.1.3" }, "funding": [ { @@ -5056,7 +5056,7 @@ "type": "tidelift" } ], - "time": "2022-05-23T10:32:57+00:00" + "time": "2022-07-29T07:42:06+00:00" }, { "name": "symfony/event-dispatcher", @@ -5222,16 +5222,16 @@ }, { "name": "symfony/finder", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f" + "reference": "39696bff2c2970b3779a5cac7bf9f0b88fc2b709" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/45b8beb69d6eb3b05a65689ebfd4222326773f8f", - "reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f", + "url": "https://api.github.com/repos/symfony/finder/zipball/39696bff2c2970b3779a5cac7bf9f0b88fc2b709", + "reference": "39696bff2c2970b3779a5cac7bf9f0b88fc2b709", "shasum": "" }, "require": { @@ -5266,7 +5266,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.1.0" + "source": "https://github.com/symfony/finder/tree/v6.1.3" }, "funding": [ { @@ -5282,20 +5282,20 @@ "type": "tidelift" } ], - "time": "2022-04-15T08:08:08+00:00" + "time": "2022-07-29T07:42:06+00:00" }, { "name": "symfony/http-foundation", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "86119d294e51afe4d8e07da96b63332bd1f3f52c" + "reference": "b03712c93759a81fc243ecc18ec4637958afebdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/86119d294e51afe4d8e07da96b63332bd1f3f52c", - "reference": "86119d294e51afe4d8e07da96b63332bd1f3f52c", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b03712c93759a81fc243ecc18ec4637958afebdb", + "reference": "b03712c93759a81fc243ecc18ec4637958afebdb", "shasum": "" }, "require": { @@ -5338,7 +5338,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.1.2" + "source": "https://github.com/symfony/http-foundation/tree/v6.1.3" }, "funding": [ { @@ -5354,20 +5354,20 @@ "type": "tidelift" } ], - "time": "2022-06-19T13:21:48+00:00" + "time": "2022-07-27T15:50:51+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "8aaede489900dda61aee208557f63bfa1bca0877" + "reference": "0692bc185a1dbb54864686a1fc6785667279da70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8aaede489900dda61aee208557f63bfa1bca0877", - "reference": "8aaede489900dda61aee208557f63bfa1bca0877", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/0692bc185a1dbb54864686a1fc6785667279da70", + "reference": "0692bc185a1dbb54864686a1fc6785667279da70", "shasum": "" }, "require": { @@ -5448,7 +5448,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.1.2" + "source": "https://github.com/symfony/http-kernel/tree/v6.1.3" }, "funding": [ { @@ -5464,20 +5464,20 @@ "type": "tidelift" } ], - "time": "2022-06-26T17:06:14+00:00" + "time": "2022-07-29T12:59:10+00:00" }, { "name": "symfony/mailer", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "8fa150355115ea09238858ae3cfaf249fd1fd5ed" + "reference": "b2db228a93278863d1567f90d7caf26922dbfede" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/8fa150355115ea09238858ae3cfaf249fd1fd5ed", - "reference": "8fa150355115ea09238858ae3cfaf249fd1fd5ed", + "url": "https://api.github.com/repos/symfony/mailer/zipball/b2db228a93278863d1567f90d7caf26922dbfede", + "reference": "b2db228a93278863d1567f90d7caf26922dbfede", "shasum": "" }, "require": { @@ -5522,7 +5522,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v6.1.2" + "source": "https://github.com/symfony/mailer/tree/v6.1.3" }, "funding": [ { @@ -5538,20 +5538,20 @@ "type": "tidelift" } ], - "time": "2022-06-19T13:21:48+00:00" + "time": "2022-07-27T15:50:51+00:00" }, { "name": "symfony/mime", - "version": "v6.1.1", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "56508865dd883dce3c863af11b3e8053adab30d7" + "reference": "9c0247994fc6584da8591ba64b2bffaace9df87d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/56508865dd883dce3c863af11b3e8053adab30d7", - "reference": "56508865dd883dce3c863af11b3e8053adab30d7", + "url": "https://api.github.com/repos/symfony/mime/zipball/9c0247994fc6584da8591ba64b2bffaace9df87d", + "reference": "9c0247994fc6584da8591ba64b2bffaace9df87d", "shasum": "" }, "require": { @@ -5603,7 +5603,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.1.1" + "source": "https://github.com/symfony/mime/tree/v6.1.3" }, "funding": [ { @@ -5619,7 +5619,7 @@ "type": "tidelift" } ], - "time": "2022-06-09T12:51:38+00:00" + "time": "2022-07-20T13:46:29+00:00" }, { "name": "symfony/polyfill-ctype", @@ -6365,16 +6365,16 @@ }, { "name": "symfony/process", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "318718453c2be58266f1a9e74063d13cb8dd4165" + "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/318718453c2be58266f1a9e74063d13cb8dd4165", - "reference": "318718453c2be58266f1a9e74063d13cb8dd4165", + "url": "https://api.github.com/repos/symfony/process/zipball/a6506e99cfad7059b1ab5cab395854a0a0c21292", + "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292", "shasum": "" }, "require": { @@ -6406,7 +6406,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.1.0" + "source": "https://github.com/symfony/process/tree/v6.1.3" }, "funding": [ { @@ -6422,7 +6422,7 @@ "type": "tidelift" } ], - "time": "2022-05-11T12:12:29+00:00" + "time": "2022-06-27T17:24:16+00:00" }, { "name": "symfony/psr-http-message-bridge", @@ -6514,16 +6514,16 @@ }, { "name": "symfony/routing", - "version": "v6.1.1", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "8f068b792e515b25e26855ac8dc7fe800399f3e5" + "reference": "ef9108b3a88045b7546e808fb404ddb073dd35ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/8f068b792e515b25e26855ac8dc7fe800399f3e5", - "reference": "8f068b792e515b25e26855ac8dc7fe800399f3e5", + "url": "https://api.github.com/repos/symfony/routing/zipball/ef9108b3a88045b7546e808fb404ddb073dd35ea", + "reference": "ef9108b3a88045b7546e808fb404ddb073dd35ea", "shasum": "" }, "require": { @@ -6582,7 +6582,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.1.1" + "source": "https://github.com/symfony/routing/tree/v6.1.3" }, "funding": [ { @@ -6598,7 +6598,7 @@ "type": "tidelift" } ], - "time": "2022-06-08T12:21:15+00:00" + "time": "2022-07-20T15:00:40+00:00" }, { "name": "symfony/service-contracts", @@ -6687,16 +6687,16 @@ }, { "name": "symfony/string", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "1903f2879875280c5af944625e8246d81c2f0604" + "reference": "f35241f45c30bcd9046af2bb200a7086f70e1d6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/1903f2879875280c5af944625e8246d81c2f0604", - "reference": "1903f2879875280c5af944625e8246d81c2f0604", + "url": "https://api.github.com/repos/symfony/string/zipball/f35241f45c30bcd9046af2bb200a7086f70e1d6b", + "reference": "f35241f45c30bcd9046af2bb200a7086f70e1d6b", "shasum": "" }, "require": { @@ -6752,7 +6752,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.2" + "source": "https://github.com/symfony/string/tree/v6.1.3" }, "funding": [ { @@ -6768,20 +6768,20 @@ "type": "tidelift" } ], - "time": "2022-06-26T16:35:04+00:00" + "time": "2022-07-27T15:50:51+00:00" }, { "name": "symfony/translation", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "b254416631615bc6fe49b0a67f18658827288147" + "reference": "b042e16087d298d08c1f013ff505d16c12a3b1be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/b254416631615bc6fe49b0a67f18658827288147", - "reference": "b254416631615bc6fe49b0a67f18658827288147", + "url": "https://api.github.com/repos/symfony/translation/zipball/b042e16087d298d08c1f013ff505d16c12a3b1be", + "reference": "b042e16087d298d08c1f013ff505d16c12a3b1be", "shasum": "" }, "require": { @@ -6848,7 +6848,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.1.0" + "source": "https://github.com/symfony/translation/tree/v6.1.3" }, "funding": [ { @@ -6864,7 +6864,7 @@ "type": "tidelift" } ], - "time": "2022-05-11T12:12:29+00:00" + "time": "2022-07-20T13:46:29+00:00" }, { "name": "symfony/translation-contracts", @@ -6949,16 +6949,16 @@ }, { "name": "symfony/var-dumper", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "98587d939cb783aa04e828e8fa857edaca24c212" + "reference": "d5a5e44a2260c5eb5e746bf4f1fbd12ee6ceb427" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/98587d939cb783aa04e828e8fa857edaca24c212", - "reference": "98587d939cb783aa04e828e8fa857edaca24c212", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d5a5e44a2260c5eb5e746bf4f1fbd12ee6ceb427", + "reference": "d5a5e44a2260c5eb5e746bf4f1fbd12ee6ceb427", "shasum": "" }, "require": { @@ -7017,7 +7017,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.1.0" + "source": "https://github.com/symfony/var-dumper/tree/v6.1.3" }, "funding": [ { @@ -7033,20 +7033,20 @@ "type": "tidelift" } ], - "time": "2022-05-21T13:34:40+00:00" + "time": "2022-07-20T13:46:29+00:00" }, { "name": "symfony/yaml", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "b01c4e7dc6a51cbf114567af04a19789fd1011fe" + "reference": "cc48dd42ae1201abced04ae38284e23ce2d2d8f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/b01c4e7dc6a51cbf114567af04a19789fd1011fe", - "reference": "b01c4e7dc6a51cbf114567af04a19789fd1011fe", + "url": "https://api.github.com/repos/symfony/yaml/zipball/cc48dd42ae1201abced04ae38284e23ce2d2d8f3", + "reference": "cc48dd42ae1201abced04ae38284e23ce2d2d8f3", "shasum": "" }, "require": { @@ -7091,7 +7091,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.1.2" + "source": "https://github.com/symfony/yaml/tree/v6.1.3" }, "funding": [ { @@ -7107,7 +7107,7 @@ "type": "tidelift" } ], - "time": "2022-06-20T12:01:07+00:00" + "time": "2022-07-20T14:45:06+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -7774,22 +7774,23 @@ }, { "name": "laravel/breeze", - "version": "v1.11.1", + "version": "v1.11.2", "source": { "type": "git", "url": "https://github.com/laravel/breeze.git", - "reference": "416c0923860dcef96b977bd4d385c681f65e896a" + "reference": "0568bd257f0985645d5f4bb10f9f37ad9e46d414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/breeze/zipball/416c0923860dcef96b977bd4d385c681f65e896a", - "reference": "416c0923860dcef96b977bd4d385c681f65e896a", + "url": "https://api.github.com/repos/laravel/breeze/zipball/0568bd257f0985645d5f4bb10f9f37ad9e46d414", + "reference": "0568bd257f0985645d5f4bb10f9f37ad9e46d414", "shasum": "" }, "require": { - "illuminate/filesystem": "^9.0", - "illuminate/support": "^9.0", - "illuminate/validation": "^9.0", + "illuminate/console": "^9.21", + "illuminate/filesystem": "^9.21", + "illuminate/support": "^9.21", + "illuminate/validation": "^9.21", "php": "^8.0.2" }, "conflict": { @@ -7830,7 +7831,7 @@ "issues": "https://github.com/laravel/breeze/issues", "source": "https://github.com/laravel/breeze" }, - "time": "2022-07-19T14:03:23+00:00" + "time": "2022-07-20T16:08:11+00:00" }, { "name": "laravel/sail", diff --git a/database/migrations/2022_07_26_214231_create_responses_table.php b/database/migrations/2022_07_26_214231_create_responses_table.php new file mode 100644 index 00000000..6e3e3677 --- /dev/null +++ b/database/migrations/2022_07_26_214231_create_responses_table.php @@ -0,0 +1,34 @@ +id(); + $table->text('response'); + $table->integer('user_id'); + $table->integer('blog_id'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('responses'); + } +}; diff --git a/package-lock.json b/package-lock.json index bbcdb258..65438559 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2008,9 +2008,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.29", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", - "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", + "version": "4.17.30", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.30.tgz", + "integrity": "sha512-gstzbTWro2/nFed1WXtf+TtrpwxH7Ggs4RLYTLbeVgIkUQOI3WG/JKjgeOU1zXDvezllupjrf8OPIdvTbIaVOQ==", "dev": true, "dependencies": { "@types/node": "*", @@ -2102,9 +2102,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.6.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.1.tgz", - "integrity": "sha512-z+2vB6yDt1fNwKOeGbckpmirO+VBDuQqecXkgeIqDlaOtmKn6hPR/viQ8cxCfqLU4fTlvM3+YjM367TukWdxpg==", + "version": "18.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.2.tgz", + "integrity": "sha512-KcfkBq9H4PI6Vpu5B/KoPeuVDAbmi+2mDBqGPGUgoL7yXQtcWGu2vJWmmRkneWK3Rh0nIAX192Aa87AqKHYChQ==", "dev": true }, "node_modules/@types/parse-json": { @@ -2590,9 +2590,9 @@ } }, "node_modules/autoprefixer": { - "version": "10.4.7", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.7.tgz", - "integrity": "sha512-ypHju4Y2Oav95SipEcCcI5J7CGPuvz8oat7sUtYj3ClK44bldfvtvcxK6IEK++7rqB7YchDGzweZIBG+SD0ZAA==", + "version": "10.4.8", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.8.tgz", + "integrity": "sha512-75Jr6Q/XpTqEf6D2ltS5uMewJIx5irCU1oBYJrWjFenq/m12WRRrz6g15L1EIoYvPLXTbEry7rDOwrcYNj77xw==", "funding": [ { "type": "opencollective", @@ -2604,8 +2604,8 @@ } ], "dependencies": { - "browserslist": "^4.20.3", - "caniuse-lite": "^1.0.30001335", + "browserslist": "^4.21.3", + "caniuse-lite": "^1.0.30001373", "fraction.js": "^4.2.0", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", @@ -2951,9 +2951,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.2.tgz", - "integrity": "sha512-MonuOgAtUB46uP5CezYbRaYKBNt2LxP0yX+Pmj4LkcDFGkn9Cbpi83d9sCjwQDErXsIJSzY5oKGDbgOlF/LPAA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.3.tgz", + "integrity": "sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ==", "funding": [ { "type": "opencollective", @@ -2965,10 +2965,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001366", - "electron-to-chromium": "^1.4.188", + "caniuse-lite": "^1.0.30001370", + "electron-to-chromium": "^1.4.202", "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.4" + "update-browserslist-db": "^1.0.5" }, "bin": { "browserslist": "cli.js" @@ -3066,9 +3066,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001370", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001370.tgz", - "integrity": "sha512-3PDmaP56wz/qz7G508xzjx8C+MC2qEm4SYhSEzC9IBROo+dGXFWRuaXkWti0A9tuI00g+toiriVqxtWMgl350g==", + "version": "1.0.30001373", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001373.tgz", + "integrity": "sha512-pJYArGHrPp3TUqQzFYRmP/lwJlj8RCbVe3Gd3eJQkAV8SAC6b19XS9BjMvRdvaS8RMkaTN8ZhoHP6S1y8zzwEQ==", "funding": [ { "type": "opencollective", @@ -4095,9 +4095,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.201", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.201.tgz", - "integrity": "sha512-87D0gEHbhLZgZxZl2e9/rC/I2BicPC/y9wR/cuaJSqvkgN41s5EImi89S7YExHc7F0OBXiKsABZt9mmb9bqFcQ==" + "version": "1.4.206", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.206.tgz", + "integrity": "sha512-h+Fadt1gIaQ06JaIiyqPsBjJ08fV5Q7md+V8bUvQW/9OvXfL2LRICTz2EcnnCP7QzrFTS6/27MRV6Bl9Yn97zA==" }, "node_modules/elliptic": { "version": "6.5.4", @@ -10812,9 +10812,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.29", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", - "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", + "version": "4.17.30", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.30.tgz", + "integrity": "sha512-gstzbTWro2/nFed1WXtf+TtrpwxH7Ggs4RLYTLbeVgIkUQOI3WG/JKjgeOU1zXDvezllupjrf8OPIdvTbIaVOQ==", "dev": true, "requires": { "@types/node": "*", @@ -10906,9 +10906,9 @@ "dev": true }, "@types/node": { - "version": "18.6.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.1.tgz", - "integrity": "sha512-z+2vB6yDt1fNwKOeGbckpmirO+VBDuQqecXkgeIqDlaOtmKn6hPR/viQ8cxCfqLU4fTlvM3+YjM367TukWdxpg==", + "version": "18.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.2.tgz", + "integrity": "sha512-KcfkBq9H4PI6Vpu5B/KoPeuVDAbmi+2mDBqGPGUgoL7yXQtcWGu2vJWmmRkneWK3Rh0nIAX192Aa87AqKHYChQ==", "dev": true }, "@types/parse-json": { @@ -11336,12 +11336,12 @@ } }, "autoprefixer": { - "version": "10.4.7", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.7.tgz", - "integrity": "sha512-ypHju4Y2Oav95SipEcCcI5J7CGPuvz8oat7sUtYj3ClK44bldfvtvcxK6IEK++7rqB7YchDGzweZIBG+SD0ZAA==", + "version": "10.4.8", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.8.tgz", + "integrity": "sha512-75Jr6Q/XpTqEf6D2ltS5uMewJIx5irCU1oBYJrWjFenq/m12WRRrz6g15L1EIoYvPLXTbEry7rDOwrcYNj77xw==", "requires": { - "browserslist": "^4.20.3", - "caniuse-lite": "^1.0.30001335", + "browserslist": "^4.21.3", + "caniuse-lite": "^1.0.30001373", "fraction.js": "^4.2.0", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", @@ -11621,14 +11621,14 @@ } }, "browserslist": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.2.tgz", - "integrity": "sha512-MonuOgAtUB46uP5CezYbRaYKBNt2LxP0yX+Pmj4LkcDFGkn9Cbpi83d9sCjwQDErXsIJSzY5oKGDbgOlF/LPAA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.3.tgz", + "integrity": "sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ==", "requires": { - "caniuse-lite": "^1.0.30001366", - "electron-to-chromium": "^1.4.188", + "caniuse-lite": "^1.0.30001370", + "electron-to-chromium": "^1.4.202", "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.4" + "update-browserslist-db": "^1.0.5" } }, "buffer": { @@ -11708,9 +11708,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001370", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001370.tgz", - "integrity": "sha512-3PDmaP56wz/qz7G508xzjx8C+MC2qEm4SYhSEzC9IBROo+dGXFWRuaXkWti0A9tuI00g+toiriVqxtWMgl350g==" + "version": "1.0.30001373", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001373.tgz", + "integrity": "sha512-pJYArGHrPp3TUqQzFYRmP/lwJlj8RCbVe3Gd3eJQkAV8SAC6b19XS9BjMvRdvaS8RMkaTN8ZhoHP6S1y8zzwEQ==" }, "chalk": { "version": "4.1.2", @@ -12495,9 +12495,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.4.201", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.201.tgz", - "integrity": "sha512-87D0gEHbhLZgZxZl2e9/rC/I2BicPC/y9wR/cuaJSqvkgN41s5EImi89S7YExHc7F0OBXiKsABZt9mmb9bqFcQ==" + "version": "1.4.206", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.206.tgz", + "integrity": "sha512-h+Fadt1gIaQ06JaIiyqPsBjJ08fV5Q7md+V8bUvQW/9OvXfL2LRICTz2EcnnCP7QzrFTS6/27MRV6Bl9Yn97zA==" }, "elliptic": { "version": "6.5.4", diff --git a/phpunit.xml b/phpunit.xml index 5a5dff87..23a66193 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -21,7 +21,7 @@ - + diff --git a/resources/views/blogread.blade.php b/resources/views/blogread.blade.php index 616ff7e1..b55ba0f6 100644 --- a/resources/views/blogread.blade.php +++ b/resources/views/blogread.blade.php @@ -188,24 +188,77 @@ class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg- @if ($content->replies) -
+ + @auth() +
+
+ +
+
+
+ @csrf +
+ + + + + +
+
+ +
+
+
+
+ @endauth() + + @guest() + +
+
+
+
+ + +
+
+

Authentication required

+
+

Responses for this blog post are enabled but require authentication in order to respond to it. You can login here.

+
+
+
+
+
+ @endguest() + +

Responses

+ @foreach($content->Response()->get() as $r)
-
-

Emily Selman

-

+
+

{{$r->User->name}}

+

-

This icon pack is just what I need for my latest project. There's an icon for just about anything I could ever need. Love the playful look!

+

{{$r->response}}

+ @endforeach
diff --git a/routes/web.php b/routes/web.php index ba615bf2..50e477e0 100644 --- a/routes/web.php +++ b/routes/web.php @@ -396,6 +396,9 @@ Route::post('/community/user/{id}/privacy', [Community::class, 'updatePrivacy']) ->middleware(['auth', 'verified']) ->name('community.update-privacy'); +Route::post('/blog/{slug}/response/create', [Blog::class, 'response']) + ->middleware(['auth', 'verified']) + ->name('blog.response.create'); //API GET ROUTES Route::prefix('api')->group(function () {