Commit 0030d316 authored by SadeghPM's avatar SadeghPM

Add Amount column to payments table

parent de5dd8ec
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePaymentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('payments', function ($table) {
$table->unsignedBigInteger('amount')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}
......@@ -16,6 +16,7 @@ use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Trix;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Fields\Number;
class Payment extends Resource
{
......@@ -79,6 +80,9 @@ class Payment extends Resource
\Dpsoft\Mehr4Payment\Payment::SUCCESS => 'موفق',
\Dpsoft\Mehr4Payment\Payment::FAIL => 'ناموفق',
])->displayUsingLabels()->sortable()->hideFromDetail()->hideFromIndex()->required(),
Number::make('مبلغ', 'amount')->displayUsing(function ($price){
return number_format($price,0);
})->nullable(),
Trix::make('یادداشت','comment'),
Text::make('شماره سفارش','order_id')->required()->creationRules('unique:payments,order_id'),
Text::make('شماره ارجاع','reference_id')->nullable(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment