¨4.0.1¨
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Modules\Transaction\Admin;
|
||||
|
||||
use Modules\Admin\Ui\AdminTable;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class TransactionTable extends AdminTable
|
||||
{
|
||||
@@ -11,12 +12,13 @@ class TransactionTable extends AdminTable
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $rawColumns = ['order_id'];
|
||||
protected array $rawColumns = ['order_id'];
|
||||
|
||||
|
||||
/**
|
||||
* Make table response for the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function make()
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ class CreateTransactionsTable extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
|
||||
@@ -35,16 +35,19 @@ class Transaction extends Model
|
||||
*/
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
|
||||
public function order()
|
||||
{
|
||||
return $this->belongsTo(Order::class);
|
||||
}
|
||||
|
||||
|
||||
public function getPaymentMethodAttribute($paymentMethod)
|
||||
{
|
||||
return Gateway::get($paymentMethod)->label ?? '';
|
||||
}
|
||||
|
||||
|
||||
public function table()
|
||||
{
|
||||
return new TransactionTable($this->newQuery());
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace Modules\Transaction\Http\Controllers\Admin;
|
||||
|
||||
use Modules\Admin\Traits\HasCrudActions;
|
||||
use Modules\Transaction\Entities\Transaction;
|
||||
use Modules\Transaction\Http\Requests\SaveTransactionRequest;
|
||||
|
||||
class TransactionController
|
||||
{
|
||||
@@ -30,11 +29,4 @@ class TransactionController
|
||||
* @var string
|
||||
*/
|
||||
protected $viewPath = 'transaction::admin.transactions';
|
||||
|
||||
/**
|
||||
* Form requests for the resource.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $validation = SaveTransactionRequest::class;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
@section('content')
|
||||
<div class="box box-primary">
|
||||
<div class="box-body index-table" id="transactions-table"">
|
||||
<div class="box-body index-table" id="transactions-table">
|
||||
@component('admin::components.table')
|
||||
@slot('thead')
|
||||
<tr>
|
||||
@@ -24,9 +24,9 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
<script type="module">
|
||||
DataTable.setRoutes('#transactions-table .table', {
|
||||
index: '{{ "admin.transactions.index" }}',
|
||||
table: '{{ "admin.transactions.table" }}',
|
||||
});
|
||||
|
||||
new DataTable('#transactions-table .table', {
|
||||
|
||||
@@ -7,3 +7,9 @@ Route::get('transactions', [
|
||||
'uses' => 'TransactionController@index',
|
||||
'middleware' => 'can:admin.transactions.index',
|
||||
]);
|
||||
|
||||
Route::get('transactions/index/table', [
|
||||
'as' => 'admin.transactions.table',
|
||||
'uses' => 'TransactionController@table',
|
||||
'middleware' => 'can:admin.transactions.index',
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user