From 6fa88daeb0b6124a00bf73affdfb54e1e6d5a81d Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 8 Oct 2021 12:19:33 +1100 Subject: [PATCH] Minor fix to SearchController, updated composer.json based on other projects --- app/Http/Controllers/SearchController.php | 11 ++++---- composer.json | 31 ++++++++++++----------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 893ab44..3189fd0 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -3,7 +3,7 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; -use Illuminate\Http\Response; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Gate; @@ -15,15 +15,16 @@ class SearchController extends Controller * Search from the Application Dashboard. * * @param Request $request - * @return Response + * @return Collection */ - public function search(Request $request) + public function search(Request $request): Collection { + $result = collect(); + // If there isnt a term value, return null if (! $request->input('term')) - return []; + return $result; - $result = collect(); $accounts = ($x=Auth::user()->all_accounts())->pluck('id'); $users = $x->transform(function($item) { return $item->user;}); diff --git a/composer.json b/composer.json index 449fe81..1375e7f 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,8 @@ "license": "MIT", "require": { "php": "^7.4|^8.0", + "ext-curl": "*", + "ext-pdo": "*", "barryvdh/laravel-snappy": "^0.4.6", "clarkeash/doorman": "^6.0", "doctrine/dbal": "^2.10", @@ -15,7 +17,7 @@ "guzzlehttp/guzzle": "^7.0.1", "hmazter/laravel-schedule-list": "^2.1", "intervention/image": "^2.5", - "laravel/framework": "^8.12", + "laravel/framework": "^8.54", "laravel/passport": "^10.1", "laravel/socialite": "^5.2", "laravel/ui": "^3.2", @@ -29,23 +31,12 @@ }, "require-dev": { "barryvdh/laravel-debugbar": "^3.5", - "barryvdh/laravel-ide-helper": "^2.10", "facade/ignition": "^2.5", "fakerphp/faker": "^1.9.1", "mockery/mockery": "^1.4.2", "nunomaduro/collision": "^5.0", "phpunit/phpunit": "^9.3.3" }, - "config": { - "optimize-autoloader": true, - "preferred-install": "dist", - "sort-packages": true - }, - "extra": { - "laravel": { - "dont-discover": [] - } - }, "autoload": { "psr-4": { "App\\": "app/", @@ -68,8 +59,6 @@ "url": "https://github.com/leenooks/laravel-theme" } ], - "minimum-stability": "dev", - "prefer-stable": true, "scripts": { "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", @@ -81,5 +70,17 @@ "post-create-project-cmd": [ "@php artisan key:generate --ansi" ] - } + }, + "extra": { + "laravel": { + "dont-discover": [] + } + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true + }, + "minimum-stability": "dev", + "prefer-stable": true }