diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 87fe6780..f4433937 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -26,9 +26,11 @@ class ForgotPasswordController extends Controller * @param string $response * @return \Illuminate\Http\RedirectResponse */ - protected function sendResetLinkResponse($response) - { - return ['status' => trans($response)]; + protected function sendResetLinkEmail($response) + { + $link = "http://localhost:8000/?token=123"; + return $link; + //return ['status' => trans($response)]; } /** diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index bf039683..e3c55ca7 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -42,4 +42,8 @@ class ResetPasswordController extends Controller { return response()->json(['email' => trans($response)], 400); } + + protected function showResetForm(){ + return view('index'); + } } diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index 4f16664a..47fb2e02 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -115,5 +115,6 @@ class BookingController extends Controller $booking->delete($book_id); return response()->json($book_id, 204); } - // TODO : cancel function + + // TODO : cancel booking feature } diff --git a/composer.json b/composer.json index 879902b8..0a70c54a 100644 --- a/composer.json +++ b/composer.json @@ -6,14 +6,15 @@ "type": "project", "require": { "php": "^7.1.3", + "doctrine/dbal": "^2.7", "fideloper/proxy": "^4.0", "intervention/image": "^2.4", "laravel/framework": "5.6.*", "laravel/socialite": "^3.0", "laravel/tinker": "~1.0", + "laravelcollective/html": "^5.6", "tymon/jwt-auth": "^1.0.0-rc.2", - "zizaco/entrust": "dev-master", - "laravelcollective/html": "^5.6" + "zizaco/entrust": "dev-master" }, "require-dev": { "filp/whoops": "^2.0", diff --git a/composer.lock b/composer.lock index 50a353a1..7120f28e 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "be0b3eae101bbe8134154fd539fdafaa", + "content-hash": "3f411d272d823b9e69fdedb77a2abf73", "packages": [ { "name": "dnoegel/php-xdg-base-dir", @@ -39,6 +39,363 @@ "description": "implementation of xdg base directory specification for php", "time": "2014-10-24T07:27:01+00:00" }, + { + "name": "doctrine/annotations", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2017-12-06T07:11:42+00:00" + }, + { + "name": "doctrine/cache", + "version": "v1.7.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/b3217d58609e9c8e661cd41357a54d926c4a2a1a", + "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a", + "shasum": "" + }, + "require": { + "php": "~7.1" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "alcaeus/mongo-php-adapter": "^1.1", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^5.7", + "predis/predis": "~1.0" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ], + "time": "2017-08-25T07:02:50+00:00" + }, + { + "name": "doctrine/collections", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "~0.1@dev", + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "array", + "collections", + "iterator" + ], + "time": "2017-07-22T10:37:32+00:00" + }, + { + "name": "doctrine/common", + "version": "v2.8.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "f68c297ce6455e8fd794aa8ffaf9fa458f6ade66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/f68c297ce6455e8fd794aa8ffaf9fa458f6ade66", + "reference": "f68c297ce6455e8fd794aa8ffaf9fa458f6ade66", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "doctrine/collections": "1.*", + "doctrine/inflector": "1.*", + "doctrine/lexer": "1.*", + "php": "~7.1" + }, + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common Library for Doctrine projects", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "collections", + "eventmanager", + "persistence", + "spl" + ], + "time": "2017-08-31T08:43:38+00:00" + }, + { + "name": "doctrine/dbal", + "version": "v2.7.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "11037b4352c008373561dc6fc836834eed80c3b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/11037b4352c008373561dc6fc836834eed80c3b5", + "reference": "11037b4352c008373561dc6fc836834eed80c3b5", + "shasum": "" + }, + "require": { + "doctrine/common": "^2.7.1", + "ext-pdo": "*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^4.0", + "phpunit/phpunit": "^7.0", + "phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5", + "symfony/console": "^2.0.5||^3.0", + "symfony/phpunit-bridge": "^3.4.5|^4.0.5" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\DBAL\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Database Abstraction Layer", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "database", + "dbal", + "persistence", + "queryobject" + ], + "time": "2018-04-07T18:44:18+00:00" + }, { "name": "doctrine/inflector", "version": "v1.3.0", diff --git a/database/migrations/2018_06_09_014605_make_usd_nullable_in_booking_table.php b/database/migrations/2018_06_09_014605_make_usd_nullable_in_booking_table.php new file mode 100644 index 00000000..3925684a --- /dev/null +++ b/database/migrations/2018_06_09_014605_make_usd_nullable_in_booking_table.php @@ -0,0 +1,37 @@ +double('usd_book_amount', 50)->nullable()->change(); + $table->string('usd_book_pay_method')->nullable()->change(); + $table->string('usd_book_company_name')->nullable()->change(); + $table->string('usd_book_company_address')->nullable()->change(); + $table->string('usd_book_swift_code')->nullable()->change(); + $table->string('usd_book_cnap')->nullable()->change(); + $table->string('usd_book_bank_branch')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/readme.md b/readme.md index 5c6326be..e4f0893d 100644 --- a/readme.md +++ b/readme.md @@ -1,16 +1,12 @@ -# Laravel-Vue SPA +# Currency Exchange (MYR, RMB, USD) -Build Status -Total Downloads -Latest Stable Version - -> A Laravel-Vue SPA starter project template. +> A currency exchange system that user able to book their rate and upload their backin slip. For admin backend, they can perform booking with supplier, update booking status, etc. Using a Laravel-Vue SPA starter project template.

-## Features +## TechStack - Laravel 5.6 - Vue + VueRouter + Vuex + VueI18n + ESlint @@ -22,14 +18,19 @@ ## Installation -- `composer create-project --prefer-dist cretueusebiu/laravel-vue-spa` +- `git clone git@gitlab.com:CIEFWorldwideSdnBhd/exchange.git` +- Copy `.env-example` to `.env` - Edit `.env` and set your database connection details -- (When installed via git clone or download, run `php artisan key:generate` and `php artisan jwt:secret`) +- `Comp` run `php artisan key:generate` and `php artisan jwt:secret`) - `php artisan migrate` - `yarn` / `npm install` ## Usage +#### Test Credentials +`user@example.com:secret` +`admin@example.com:secret` + #### Development ```bash diff --git a/routes/api.php b/routes/api.php index bec708df..90ee9b81 100644 --- a/routes/api.php +++ b/routes/api.php @@ -24,7 +24,7 @@ Route::middleware('auth:api')->get('/user', function (Request $request) { /*Route for the booking */ Route::get('/booking', 'BookingController@index'); Route::get('/booking/{book_id}', 'BookingController@show'); -Route::post('/booking/', 'BookingController@store'); +Route::post('/booking', 'BookingController@store'); Route::put('/booking/{book_id}', 'BookingController@update'); Route::delete('/booking/{book_id}', 'BookingController@delete'); diff --git a/tests/Feature/BookingTest.php b/tests/Feature/BookingTest.php index 71cbb641..55d9a2d4 100644 --- a/tests/Feature/BookingTest.php +++ b/tests/Feature/BookingTest.php @@ -2,17 +2,14 @@ namespace Tests\Unit\BookingTest; -use Tests\TestCase; -use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Database\Seeder; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Artisan; use App\User; +use Artisan; +use Tests\TestCase; class BookingTest extends TestCase { protected $user; - + public function setUp() { parent::setUp(); @@ -20,24 +17,33 @@ class BookingTest extends TestCase $this->user = factory(User::class)->create(); } - public function testPost() - { - $response = - $this->actingAs($this->user) - ->postJson('/api/booking/', [ + public function testPost() + { + $response = + $this->actingAs($this->user) + ->postJson('/api/booking/', [ + 'term' => 'x1_ba', 'account_name' => 'johnny', - 'account_num' => '1234567', - 'bank_name' => 'myabnak', - 'bank_branch' => 'banking', - 'company_name' => 'besaras', - 'company_address' => 'californina', - 'bank_address' => 'cyber', - 'swift_code' => '123wert', + 'account_num' => '1234567', + 'bank_name' => 'myabnak', + 'bank_branch' => 'banking', + 'company_name' => 'besaras', + 'company_address' => 'californina', + 'bank_address' => 'cyber', + 'swift_code' => '123wert', 'cnap' => '2131rew', 'term' => 'x2_cash', - 'amount' => '14000' + 'rmb_book_amount' => 14000, + 'rmb_book_pay_method' => 'x1_ba', + 'rmb_book_account_name' => 'Xiao Xue', + 'rmb_book_acc_no' => '12332123123', + 'rmb_book_bank_branch' => 'ShenZhen', + 'amount' => 14000, ]); - $response->assertStatus(500); - } + dd($response->getContent()); + $response->assertStatus(200); + + } + -} \ No newline at end of file +}