added contact filter for transactions #33ywwz1
This commit is contained in:
parent
7886355a50
commit
80dc7707ef
33
app/Http/Controllers/Common/Contacts.php
Normal file
33
app/Http/Controllers/Common/Contacts.php
Normal 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' => '',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
@ -122,7 +122,9 @@ return [
|
|||||||
'route' => ['currencies.index', 'search=enabled:1'],
|
'route' => ['currencies.index', 'search=enabled:1'],
|
||||||
],
|
],
|
||||||
'document_id',
|
'document_id',
|
||||||
'contact_id',
|
'contact_id' => [
|
||||||
|
'route' => 'contacts.index',
|
||||||
|
],
|
||||||
'description' => ['searchable' => true],
|
'description' => ['searchable' => true],
|
||||||
'payment_method',
|
'payment_method',
|
||||||
'reference',
|
'reference',
|
||||||
|
@ -46,6 +46,8 @@ Route::group(['prefix' => 'common'], function () {
|
|||||||
Route::get('reports/{report}/clear', 'Common\Reports@clear')->name('reports.clear');
|
Route::get('reports/{report}/clear', 'Common\Reports@clear')->name('reports.clear');
|
||||||
Route::get('reports/fields', 'Common\Reports@fields')->name('reports.fields');
|
Route::get('reports/fields', 'Common\Reports@fields')->name('reports.fields');
|
||||||
Route::resource('reports', 'Common\Reports');
|
Route::resource('reports', 'Common\Reports');
|
||||||
|
|
||||||
|
Route::get('contacts/index', 'Common\Contacts@index')->name('contacts.index');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::group(['prefix' => 'auth'], function () {
|
Route::group(['prefix' => 'auth'], function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user