mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
Fix some error due to update migration
This commit is contained in:
@@ -126,7 +126,6 @@ class BookingController extends Controller
|
||||
}
|
||||
|
||||
return $bookings;
|
||||
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
@@ -294,7 +293,7 @@ class BookingController extends Controller
|
||||
|
||||
return response()->json(['book_id'=>$book_id],200);
|
||||
}
|
||||
//upload
|
||||
|
||||
public function uploadbankslip(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
@@ -416,7 +415,7 @@ class BookingController extends Controller
|
||||
|
||||
$user_po = new PurchaseOrder;
|
||||
$user_po->image_path = $upload_path;
|
||||
$user_po->book_id = $booking->id;
|
||||
$user_po->booking_id = $booking->id;
|
||||
$user_po->save();
|
||||
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
@@ -582,7 +581,7 @@ class BookingController extends Controller
|
||||
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
//upload
|
||||
|
||||
public function uploadInvoice(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
@@ -636,4 +635,12 @@ class BookingController extends Controller
|
||||
return response()->json(['message'=>"Success"],200);
|
||||
}
|
||||
|
||||
public function report(Request $request){
|
||||
$conv = new \Anam\PhantomMagick\Converter();
|
||||
$conv->source('http://google.com')
|
||||
->toPng()
|
||||
->save('/your/destination//google.png');
|
||||
$conv->toPng();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class ChinaBankSlipController extends Controller
|
||||
public function store(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('id',$id)->firstOrFail();
|
||||
|
||||
|
||||
// TODO : put this after check file exist
|
||||
// validate file format
|
||||
$validator = Validator::make($request->all(), [
|
||||
@@ -26,7 +26,6 @@ class ChinaBankSlipController extends Controller
|
||||
return response()->json(['message'=>'Incorrect format'],200);
|
||||
}
|
||||
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
'china_bank_slips' => 'max:3072'
|
||||
]);
|
||||
@@ -36,7 +35,6 @@ class ChinaBankSlipController extends Controller
|
||||
return response()->json(['message'=>'Image too large, upload files up to 3 MB'], 400);
|
||||
}
|
||||
|
||||
|
||||
if($bankslip_file = $request->file('file')){
|
||||
|
||||
$filename = $bankslip_file->getClientOriginalName();
|
||||
@@ -53,7 +51,7 @@ class ChinaBankSlipController extends Controller
|
||||
} else {
|
||||
return response()->json(['message'=>'file not found'],200);
|
||||
}
|
||||
|
||||
|
||||
$china_bankslip = new ChinaBankSlip;
|
||||
$china_bankslip->booking_id = $booking->id;
|
||||
$china_bankslip->china_bank_slip_path = $upload_path;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"anam/phantomjs-linux-x86-binary": "^2.1",
|
||||
"anam/phantommagick": "^2.0",
|
||||
"doctrine/dbal": "^2.7",
|
||||
"fideloper/proxy": "^4.0",
|
||||
"intervention/image": "^2.4",
|
||||
|
||||
Generated
+102
-1
@@ -4,8 +4,109 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "3f411d272d823b9e69fdedb77a2abf73",
|
||||
"content-hash": "ddd72723f2b2771f46fc8078594cf40a",
|
||||
"packages": [
|
||||
{
|
||||
"name": "anam/phantomjs-linux-x86-binary",
|
||||
"version": "v2.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/anam-hossain/phantomjs-linux-x86-binary.git",
|
||||
"reference": "cb90cd0e7bd4ad34f52e6834783b1c5adae15014"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/anam-hossain/phantomjs-linux-x86-binary/zipball/cb90cd0e7bd4ad34f52e6834783b1c5adae15014",
|
||||
"reference": "cb90cd0e7bd4ad34f52e6834783b1c5adae15014",
|
||||
"shasum": ""
|
||||
},
|
||||
"bin": [
|
||||
"bin/phantomjs"
|
||||
],
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Anam\\PhantomLinux\\": "/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-2-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Anam hossain",
|
||||
"email": "enam33@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "PhantomJS static linked binary for 64 bit linux systems. Most of Linux distributions are supported including Ubuntu, Debian, Fedora and CentOS.",
|
||||
"homepage": "http://phantomjs.org/download.html",
|
||||
"keywords": [
|
||||
"binary",
|
||||
"phantomjs",
|
||||
"phantomjs binary"
|
||||
],
|
||||
"time": "2016-04-05T05:24:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "anam/phantommagick",
|
||||
"version": "v2.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/anam-hossain/phantommagick.git",
|
||||
"reference": "7da1cb92198717e5aba7a4a8c9b8eb61c3ae12eb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/anam-hossain/phantommagick/zipball/7da1cb92198717e5aba7a4a8c9b8eb61c3ae12eb",
|
||||
"reference": "7da1cb92198717e5aba7a4a8c9b8eb61c3ae12eb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"league/flysystem": "~1.0",
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "~0.9",
|
||||
"phpunit/phpunit": "~4.4"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Anam\\PhantomMagick\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Anam hossain",
|
||||
"email": "enam33@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "PhantomMagick provides a simple API to ease the process of converting HTML to PDF or images",
|
||||
"homepage": "https://github.com/anam-hossain/phantommagick",
|
||||
"keywords": [
|
||||
"Html 2 jpg",
|
||||
"Html 2 pdf",
|
||||
"Laravel pdf",
|
||||
"Phantom",
|
||||
"Screen capture",
|
||||
"converter",
|
||||
"html to image",
|
||||
"html to pdf",
|
||||
"html to png",
|
||||
"image converter",
|
||||
"invoice",
|
||||
"laravel",
|
||||
"pdf",
|
||||
"pdf converter",
|
||||
"phantomjs"
|
||||
],
|
||||
"time": "2017-08-07T09:06:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "dnoegel/php-xdg-base-dir",
|
||||
"version": "0.1",
|
||||
|
||||
@@ -169,6 +169,7 @@ return [
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
|
||||
'Anam\PhantomMagick\ConverterServiceProvider'
|
||||
],
|
||||
|
||||
/*
|
||||
@@ -219,6 +220,7 @@ return [
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
'Html' => Collective\Html\HtmlFacade::class,
|
||||
'Entrust' => Zizaco\Entrust\EntrustFacade::class,
|
||||
'Converter' => 'Anam\PhantomMagick\Facades\Converter'
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
@@ -30,6 +30,6 @@ class CreateUsersTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
// Schema::dropIfExists('users');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,6 @@ class CreateRatesTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('rates');
|
||||
// Schema::dropIfExists('rates');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ class CreateBookingsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('bookings');
|
||||
|
||||
// Schema::dropIfExists('bookings');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ class RenameBookingForeignkeyInPoTable extends Migration
|
||||
{
|
||||
Schema::table('purchase_orders', function($table)
|
||||
{
|
||||
$table->dropForeign('book_id');
|
||||
$table->dropForeign('purchase_orders_book_id_foreign');
|
||||
$table->dropColumn('book_id');
|
||||
$table->integer('booking_id')->unsigned();
|
||||
$table->foreign('booking_id')->references('id')->on('bookings');
|
||||
});
|
||||
|
||||
@@ -16,7 +16,6 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(RolesAndPermissionsSeeder::class);
|
||||
$this->call(UserRoleSeeder::class);
|
||||
$this->call(RateTableSeeder::class);
|
||||
$this->call(BookTableSeeder::class);
|
||||
$this->call(CreditTableSeeder::class);
|
||||
$this->call(BookTableSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,6 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
Route::patch('/booking/{id}/update-china-bankslip','ChinaBankSlipController@update');
|
||||
|
||||
Route::get('/booking/{id}/po', 'BookingController@showPurchaseOrder');
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -11,18 +11,26 @@ use Artisan;
|
||||
|
||||
class ChinaBankSlipTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
public function setUp(){
|
||||
parent::setUp();
|
||||
Artisan::call('db:seed');
|
||||
|
||||
$this->user = factory(User::class)->create();
|
||||
$this->booking = factory(Booking::class)->create([
|
||||
'user_id' => $this->user->id
|
||||
]);
|
||||
$this->user->attachRole(Role::Where('name','admin')->first());
|
||||
}
|
||||
|
||||
public function testStore(){
|
||||
Storage::fake('file');
|
||||
$size_in_kb = 3072; // 3072KB = 3MB
|
||||
$china_bank_slips_path = UploadedFile::fake()->image('comp.jpg')->size($size_in_kb);
|
||||
|
||||
$response =
|
||||
$this->postJson('api/upload-china-bankslip',[
|
||||
$this->postJson('api/booking/' . $user->id . 'upload-china-bankslip',[
|
||||
'china_bank_slips' => $china_bank_slips_path,
|
||||
'actual_transfer_amount' => '12',
|
||||
'details' => "123123",
|
||||
|
||||
+8
@@ -6,6 +6,13 @@ $vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Anam\\PhantomLinux\\Path' => $vendorDir . '/anam/phantomjs-linux-x86-binary/Path.php',
|
||||
'Anam\\PhantomMagick\\Adapter' => $vendorDir . '/anam/phantommagick/src/Adapter.php',
|
||||
'Anam\\PhantomMagick\\Converter' => $vendorDir . '/anam/phantommagick/src/Converter.php',
|
||||
'Anam\\PhantomMagick\\ConverterServiceProvider' => $vendorDir . '/anam/phantommagick/src/ConverterServiceProvider.php',
|
||||
'Anam\\PhantomMagick\\Facades\\Converter' => $vendorDir . '/anam/phantommagick/src/Facades/Converter.php',
|
||||
'Anam\\PhantomMagick\\Runner' => $vendorDir . '/anam/phantommagick/src/Runner.php',
|
||||
'Anam\\PhantomMagick\\Str' => $vendorDir . '/anam/phantommagick/src/Str.php',
|
||||
'App\\Booking' => $baseDir . '/app/Booking.php',
|
||||
'App\\ChinaBankSlip' => $baseDir . '/app/ChinaBankSlip.php',
|
||||
'App\\Console\\Kernel' => $baseDir . '/app/Console/Kernel.php',
|
||||
@@ -4145,6 +4152,7 @@ return array(
|
||||
'Tests\\Feature\\RateTest' => $baseDir . '/tests/Feature/RateTest.php',
|
||||
'Tests\\Feature\\RegisterTest' => $baseDir . '/tests/Feature/RegisterTest.php',
|
||||
'Tests\\Feature\\SettingCreditTest' => $baseDir . '/tests/Feature/SettingCreditTest.php',
|
||||
'Tests\\Feature\\SettingSupplierTest' => $baseDir . '/tests/Feature/SettingSupplierTest.php',
|
||||
'Tests\\Feature\\SettingsTest' => $baseDir . '/tests/Feature/SettingsTest.php',
|
||||
'Tests\\TestCase' => $baseDir . '/tests/TestCase.php',
|
||||
'Text_Template' => $vendorDir . '/phpunit/php-text-template/src/Template.php',
|
||||
|
||||
Vendored
+23
-5
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit50cdbea3724e5f1d6267359fe107641a
|
||||
class ComposerStaticInit6dcfe61ea7999ade723f072fea748b5a
|
||||
{
|
||||
public static $files = array (
|
||||
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
||||
@@ -138,6 +138,8 @@ class ComposerStaticInit50cdbea3724e5f1d6267359fe107641a
|
||||
'A' =>
|
||||
array (
|
||||
'App\\' => 4,
|
||||
'Anam\\PhantomMagick\\' => 19,
|
||||
'Anam\\PhantomLinux\\' => 18,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -384,6 +386,14 @@ class ComposerStaticInit50cdbea3724e5f1d6267359fe107641a
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/app',
|
||||
),
|
||||
'Anam\\PhantomMagick\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/anam/phantommagick/src',
|
||||
),
|
||||
'Anam\\PhantomLinux\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/anam/phantomjs-linux-x86-binary',
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
@@ -434,6 +444,13 @@ class ComposerStaticInit50cdbea3724e5f1d6267359fe107641a
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Anam\\PhantomLinux\\Path' => __DIR__ . '/..' . '/anam/phantomjs-linux-x86-binary/Path.php',
|
||||
'Anam\\PhantomMagick\\Adapter' => __DIR__ . '/..' . '/anam/phantommagick/src/Adapter.php',
|
||||
'Anam\\PhantomMagick\\Converter' => __DIR__ . '/..' . '/anam/phantommagick/src/Converter.php',
|
||||
'Anam\\PhantomMagick\\ConverterServiceProvider' => __DIR__ . '/..' . '/anam/phantommagick/src/ConverterServiceProvider.php',
|
||||
'Anam\\PhantomMagick\\Facades\\Converter' => __DIR__ . '/..' . '/anam/phantommagick/src/Facades/Converter.php',
|
||||
'Anam\\PhantomMagick\\Runner' => __DIR__ . '/..' . '/anam/phantommagick/src/Runner.php',
|
||||
'Anam\\PhantomMagick\\Str' => __DIR__ . '/..' . '/anam/phantommagick/src/Str.php',
|
||||
'App\\Booking' => __DIR__ . '/../..' . '/app/Booking.php',
|
||||
'App\\ChinaBankSlip' => __DIR__ . '/../..' . '/app/ChinaBankSlip.php',
|
||||
'App\\Console\\Kernel' => __DIR__ . '/../..' . '/app/Console/Kernel.php',
|
||||
@@ -4573,6 +4590,7 @@ class ComposerStaticInit50cdbea3724e5f1d6267359fe107641a
|
||||
'Tests\\Feature\\RateTest' => __DIR__ . '/../..' . '/tests/Feature/RateTest.php',
|
||||
'Tests\\Feature\\RegisterTest' => __DIR__ . '/../..' . '/tests/Feature/RegisterTest.php',
|
||||
'Tests\\Feature\\SettingCreditTest' => __DIR__ . '/../..' . '/tests/Feature/SettingCreditTest.php',
|
||||
'Tests\\Feature\\SettingSupplierTest' => __DIR__ . '/../..' . '/tests/Feature/SettingSupplierTest.php',
|
||||
'Tests\\Feature\\SettingsTest' => __DIR__ . '/../..' . '/tests/Feature/SettingsTest.php',
|
||||
'Tests\\TestCase' => __DIR__ . '/../..' . '/tests/TestCase.php',
|
||||
'Text_Template' => __DIR__ . '/..' . '/phpunit/php-text-template/src/Template.php',
|
||||
@@ -4765,10 +4783,10 @@ class ComposerStaticInit50cdbea3724e5f1d6267359fe107641a
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit50cdbea3724e5f1d6267359fe107641a::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit50cdbea3724e5f1d6267359fe107641a::$prefixDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInit50cdbea3724e5f1d6267359fe107641a::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInit50cdbea3724e5f1d6267359fe107641a::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit6dcfe61ea7999ade723f072fea748b5a::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit6dcfe61ea7999ade723f072fea748b5a::$prefixDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInit6dcfe61ea7999ade723f072fea748b5a::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInit6dcfe61ea7999ade723f072fea748b5a::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user