From 9dcdcacdd68724f927778ca24153ce8a506badd1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Aug 2022 16:28:11 +0600 Subject: [PATCH] Search feature updated. --- app/Http/Controllers/PostController.php | 1 + composer.json | 1 + composer.lock | 147 +++++++++++++++++++++++- config/services.php | 2 +- resources/views/auth/login.blade.php | 11 +- 5 files changed, 159 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php index a75ffb5..d4e3c50 100644 --- a/app/Http/Controllers/PostController.php +++ b/app/Http/Controllers/PostController.php @@ -54,6 +54,7 @@ public function updatePost(Request $request) public function postSearch(){ $search_post = $_GET['query']; $posts = Post::where('title', 'LIKE', '%'.$search_post.'%')->get(); + $posts = Post::where('body', 'LIKE', '%'.$search_post.'%')->get(); return view('search', compact('posts')); } diff --git a/composer.json b/composer.json index 83c4de6..24998a2 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,7 @@ "guzzlehttp/guzzle": "^7.0.1", "laravel/framework": "^8.75", "laravel/sanctum": "^2.11", + "laravel/socialite": "^5.5", "laravel/tinker": "^2.5", "laravel/ui": "^3.4" }, diff --git a/composer.lock b/composer.lock index e4549aa..7a071e7 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": "cf14086919a839fe740e00554e4baff6", + "content-hash": "f8b1b00670f026c4cdcc4fb24529a8bc", "packages": [ { "name": "asm89/stack-cors", @@ -1254,6 +1254,75 @@ }, "time": "2022-05-16T17:09:47+00:00" }, + { + "name": "laravel/socialite", + "version": "v5.5.4", + "source": { + "type": "git", + "url": "https://github.com/laravel/socialite.git", + "reference": "3eec261bf83690dd85812587457f093e3156dca6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/socialite/zipball/3eec261bf83690dd85812587457f093e3156dca6", + "reference": "3eec261bf83690dd85812587457f093e3156dca6", + "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.10.1", + "php": "^7.2|^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0", + "phpunit/phpunit": "^8.0|^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Socialite\\SocialiteServiceProvider" + ], + "aliases": { + "Socialite": "Laravel\\Socialite\\Facades\\Socialite" + } + } + }, + "autoload": { + "psr-4": { + "Laravel\\Socialite\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel wrapper around OAuth 1 & OAuth 2 libraries.", + "homepage": "https://laravel.com", + "keywords": [ + "laravel", + "oauth" + ], + "support": { + "issues": "https://github.com/laravel/socialite/issues", + "source": "https://github.com/laravel/socialite" + }, + "time": "2022-08-08T13:27:06+00:00" + }, { "name": "laravel/tinker", "version": "v2.7.2", @@ -1721,6 +1790,82 @@ ], "time": "2022-04-17T13:12:02+00:00" }, + { + "name": "league/oauth1-client", + "version": "v1.10.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/oauth1-client.git", + "reference": "d6365b901b5c287dd41f143033315e2f777e1167" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/d6365b901b5c287dd41f143033315e2f777e1167", + "reference": "d6365b901b5c287dd41f143033315e2f777e1167", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-openssl": "*", + "guzzlehttp/guzzle": "^6.0|^7.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "php": ">=7.1||>=8.0" + }, + "require-dev": { + "ext-simplexml": "*", + "friendsofphp/php-cs-fixer": "^2.17", + "mockery/mockery": "^1.3.3", + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5||9.5" + }, + "suggest": { + "ext-simplexml": "For decoding XML-based responses." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev", + "dev-develop": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "League\\OAuth1\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Corlett", + "email": "bencorlett@me.com", + "homepage": "http://www.webcomm.com.au", + "role": "Developer" + } + ], + "description": "OAuth 1.0 Client Library", + "keywords": [ + "Authentication", + "SSO", + "authorization", + "bitbucket", + "identity", + "idp", + "oauth", + "oauth1", + "single sign on", + "trello", + "tumblr", + "twitter" + ], + "support": { + "issues": "https://github.com/thephpleague/oauth1-client/issues", + "source": "https://github.com/thephpleague/oauth1-client/tree/v1.10.1" + }, + "time": "2022-04-15T14:02:14+00:00" + }, { "name": "monolog/monolog", "version": "2.8.0", diff --git a/config/services.php b/config/services.php index 2a1d616..7dade33 100644 --- a/config/services.php +++ b/config/services.php @@ -29,5 +29,5 @@ 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], - + ]; diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 3a9ec19..08e4dfa 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -13,7 +13,16 @@
@csrf - + + +

OR