added contact filter for transactions #33ywwz1

This commit is contained in:
Denis Duliçi 2022-07-22 12:50:15 +03:00
parent 7886355a50
commit 80dc7707ef
3 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,33 @@
<?php
namespace App\Http\Controllers\Common;
use App\Abstracts\Http\Controller;
use App\Models\Common\Contact;
class Contacts extends Controller
{
/**
* Instantiate a new controller instance.
*/
public function __construct()
{
// Add CRUD permission check
$this->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' => '',
]);
}
}

View File

@ -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',

View File

@ -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 () {