Files
izyim-api/routes/api.php
T
Zain Fauzan Rofie Azizi 0a93a6b9fe redo deli info testing
2018-06-25 16:43:19 +08:00

92 lines
3.6 KiB
PHP

<?php
use Illuminate\Http\Request;
use App\Company;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
//Route::middleware('auth:api')->get('/user', function (Request $request) {
// return $request->user();
//});
Route::post('register', 'AuthController@register');
/* Authentication */
Route::post('login', 'AuthController@login');
//Route::post('recover', 'AuthController@recover');
//
//Route::group(['middleware' => ['jwt.auth']], function() {
// Route::get('logout', 'AuthController@logout');
// Route::get('test', function(){
// return response()->json(['foo'=>'bar']);
// });
//});
Route :: post('/warehouse','WarehouseController@store');
Route :: get('/warehouse/{war_id}','WarehouseController@show');
Route :: put('/warehouse/{war_id}','WarehouseController@update');
Route :: get('/warehouse','WarehouseController@index');
Route :: delete('/contacts/{contacts_id}','ContactController@destroy');
Route :: get('/contacts','ContactController@index');
Route :: post('/contacts','ContactController@store');
//Route :: post('/contacts','ContactController@store');
Route::post('password/recover', 'AuthController@recover');
Route::post('password/reset', 'AuthController@reset');
Route::post('send-verification', 'AuthController@sendVerification');
Route::post('verify-phone', 'AuthController@verifyPhone');
Route::group(['middleware' => ['jwt.auth']], function() {
Route::get('logout', 'AuthController@logout');
Route::patch('user', 'AuthController@updateUser');
Route::get('test', function(Request $request){
return response()->json(['user'=> $request->user()]);
});
/*Delivery-Info in profile menu*/
Route::get('/deliveryinfo/{com_id}','DeliveryinfoController@index');
Route::get('/deliveryinfo/{com_id}','DeliveryinfoController@show');
Route::post('/deliveryinfo', 'DeliveryinfoController@store');
Route::put('/deliveryinfo/{com_id}', 'DeliveryinfoController@update');
Route::delete('/deliveryinfo/{com_id}', 'DeliveryinfoController@destroy');
/* Company */
Route::patch('/company', 'CompanyController@update'); //update company information
Route::post('/company/company_profile/', 'CompanyController@companyProfile');//upload company profile picture
Route::post('/company/reg_cert/', 'CompanyController@regCert'); //upload registration certificaate
});
Route::post('/company', 'CompanyController@store'); //store company information
Route::put('/company/{company}', 'CompanyController@update'); //update company information
Route::get('/company/search/{company_name}', 'CompanyController@search');
/* Contacts */
Route::get('/company/search', 'CompanyController@search');
//Route::get('/company/search/{company_name}', 'CompanyController@search');//search company in contacts
Route::post('/contacts/{company_id}/request', 'ContactController@postApprove');
//Route::post('/company', 'CompanyController@uploadImage');
// Route::put('company/{}', function(Request $request, $productId) {
// $product = Company::findOrFail($productId);
// $product->update($request->all());
// return $product;
// });
// Route::put('company/{}', function(Request $request, $companyId) {
// $company = Product::findOrFail($companyId);
// $company->update($request->all());
// return $company;
// });