added booking lists controller and routes

This commit is contained in:
Jack Goh
2018-06-20 18:39:55 +08:00
parent 118ce0f819
commit 498fafd502
4 changed files with 25 additions and 3 deletions
@@ -16,6 +16,10 @@ use DateTime;
class BookingController extends Controller
{
public function index(){
return "hello";
}
public function show($id)
{
$booking = Booking::where('user_id',Auth::user()->id)->where('id', $id)->first();
@@ -12,13 +12,13 @@
<tr>
<td class="el-table_2_column_9 is-right ">Amount : </td>
<td class="el-table_2_column_9 is-left ">&nbsp;&nbsp;
<b> {{ booking.amount }} </b>
<b> RMB {{ booking.amount }} </b>
</td>
</tr>
<tr>
<td width="200" class="el-table_2_column_9 is-right ">Bankin Amount : </td>
<td width="200" class="el-table_2_column_9 is-left ">&nbsp;&nbsp;
<b> {{ booking.bankin_amount }} </b>
<b> MYR {{ booking.bankin_amount }} </b>
</td>
</tr>
</tbody>
+18
View File
@@ -433,6 +433,24 @@
}
}
},
mounted(){
axios
.get('/api/booking/')
.then((response) => {
console.log(response)
this.booking.amount = response.data.amount
this.booking.bankin_amount = response.data.bia
this.booking.timeout = response.data.timeout * 1000
this.start = true;
loading.close()
}).catch((error) => {
console.log(error)
loading.close()
this.$router.push({
name: 'notfound'
})
})
},
methods: {
// TODO fetch booking data on load
formatter(row, column) {
+1 -1
View File
@@ -49,7 +49,7 @@ Route::group(['middleware' => 'auth:api'], function () {
Route::group(['middleware' => 'guest:api'], function () {
Route::post('login', 'Auth\LoginController@login');
Route::post('login', 'Auth\LoginController@login')->name('login');
Route::post('register', 'Auth\RegisterController@register');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
Route::post('password/reset', 'Auth\ResetPasswordController@reset');