Minor fix to SearchController, updated composer.json based on other projects

This commit is contained in:
Deon George 2021-10-08 12:19:33 +11:00
parent 17e7b47cdc
commit 6fa88daeb0
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254
2 changed files with 22 additions and 20 deletions

View File

@ -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;});

View File

@ -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
}