diff --git a/app/Http/Controllers/Common/Contacts.php b/app/Http/Controllers/Common/Contacts.php new file mode 100644 index 000000000..5534193ff --- /dev/null +++ b/app/Http/Controllers/Common/Contacts.php @@ -0,0 +1,33 @@ +middleware('permission:read-sales-customers|read-purchases-vendors')->only('index'); + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return response()->json([ + 'success' => true, + 'error' => false, + 'data' => Contact::collect(), + 'message' => '', + ]); + } +} diff --git a/config/search-string.php b/config/search-string.php index 1ab1aaf13..8e92330ee 100644 --- a/config/search-string.php +++ b/config/search-string.php @@ -122,7 +122,9 @@ return [ 'route' => ['currencies.index', 'search=enabled:1'], ], 'document_id', - 'contact_id', + 'contact_id' => [ + 'route' => 'contacts.index', + ], 'description' => ['searchable' => true], 'payment_method', 'reference', diff --git a/routes/admin.php b/routes/admin.php index 0016193af..2ad6b90bf 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -46,6 +46,8 @@ Route::group(['prefix' => 'common'], function () { Route::get('reports/{report}/clear', 'Common\Reports@clear')->name('reports.clear'); Route::get('reports/fields', 'Common\Reports@fields')->name('reports.fields'); Route::resource('reports', 'Common\Reports'); + + Route::get('contacts/index', 'Common\Contacts@index')->name('contacts.index'); }); Route::group(['prefix' => 'auth'], function () {