2022-06-05 01:47:33 +02:00
< ? php
/*
|--------------------------------------------------------------------------
| 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 !
|
*/
2022-06-14 14:18:20 +02:00
use App\Http\Controllers\Auth\VendorContactLoginController ;
2022-07-31 06:25:46 +02:00
use App\Http\Controllers\BaseController ;
2022-06-13 11:59:24 +02:00
use App\Http\Controllers\VendorPortal\InvitationController ;
use App\Http\Controllers\VendorPortal\PurchaseOrderController ;
2022-07-06 07:18:41 +02:00
use App\Http\Controllers\VendorPortal\UploadController ;
2022-06-15 13:24:30 +02:00
use App\Http\Controllers\VendorPortal\VendorContactController ;
2022-08-04 08:22:48 +02:00
use App\Http\Controllers\VendorPortal\VendorContactHashLoginController ;
2022-06-13 11:59:24 +02:00
use Illuminate\Support\Facades\Route ;
2022-06-05 01:47:33 +02:00
2022-06-14 14:54:31 +02:00
Route :: get ( 'vendors' , [ VendorContactLoginController :: class , 'catch' ]) -> name ( 'vendor.catchall' ) -> middleware ([ 'domain_db' , 'contact_account' , 'vendor_locale' ]); //catch all
2022-08-04 08:30:11 +02:00
Route :: get ( 'vendor/key_login/{contact_key}' , [ VendorContactHashLoginController :: class , 'login' ]) -> name ( 'contact_login' ) -> middleware ([ 'domain_db' , 'vendor_contact_key_login' ]);
2022-06-14 14:18:20 +02:00
2022-06-13 11:59:24 +02:00
Route :: group ([ 'middleware' => [ 'invite_db' ], 'prefix' => 'vendor' , 'as' => 'vendor.' ], function () {
/*Invitation catches*/
Route :: get ( 'purchase_order/{invitation_key}' , [ InvitationController :: class , 'purchaseOrder' ]);
2023-11-07 22:21:47 +01:00
Route :: get ( 'purchase_order/{invitation_key}/download' , [ InvitationController :: class , 'download' ]); //->middleware('token_auth');
2022-06-13 11:59:24 +02:00
});
Route :: group ([ 'middleware' => [ 'auth:vendor' , 'vendor_locale' , 'domain_db' ], 'prefix' => 'vendor' , 'as' => 'vendor.' ], function () {
Route :: get ( 'dashboard' , [ PurchaseOrderController :: class , 'index' ]) -> name ( 'dashboard' );
Route :: get ( 'purchase_orders' , [ PurchaseOrderController :: class , 'index' ]) -> name ( 'purchase_orders.index' );
Route :: get ( 'purchase_orders/{purchase_order}' , [ PurchaseOrderController :: class , 'show' ]) -> name ( 'purchase_order.show' );
2023-07-15 01:17:38 +02:00
Route :: get ( 'showBlob/{hash}' , [ PurchaseOrderController :: class , 'showBlob' ]) -> name ( 'purchase_order.showBlob' );
2022-06-15 13:24:30 +02:00
Route :: get ( 'profile/{vendor_contact}/edit' , [ VendorContactController :: class , 'edit' ]) -> name ( 'profile.edit' );
Route :: put ( 'profile/{vendor_contact}/edit' , [ VendorContactController :: class , 'update' ]) -> name ( 'profile.update' );
2022-06-15 07:20:00 +02:00
Route :: post ( 'purchase_orders/bulk' , [ PurchaseOrderController :: class , 'bulk' ]) -> name ( 'purchase_orders.bulk' );
2022-06-15 08:27:21 +02:00
Route :: get ( 'logout' , [ VendorContactLoginController :: class , 'logout' ]) -> name ( 'logout' );
2022-07-06 07:18:41 +02:00
Route :: post ( 'purchase_order/upload/{purchase_order}' , [ UploadController :: class , 'upload' ]) -> name ( 'upload.store' );
2022-07-27 08:09:25 +02:00
Route :: post ( 'documents/download_multiple' , [ App\Http\Controllers\VendorPortal\DocumentController :: class , 'downloadMultiple' ]) -> name ( 'documents.download_multiple' );
Route :: get ( 'documents/{document}/download' , [ App\Http\Controllers\VendorPortal\DocumentController :: class , 'download' ]) -> name ( 'documents.download' );
2022-09-05 03:34:34 +02:00
Route :: get ( 'documents/{document}/download_pdf' , [ App\Http\Controllers\VendorPortal\DocumentController :: class , 'download' ]) -> name ( 'documents.download_pdf' );
2022-07-27 08:09:25 +02:00
Route :: resource ( 'documents' , App\Http\Controllers\VendorPortal\DocumentController :: class ) -> only ([ 'index' , 'show' ]);
2022-06-13 11:59:24 +02:00
2022-06-15 07:20:00 +02:00
});
2022-08-07 08:27:14 +02:00
2022-07-31 06:25:46 +02:00
Route :: fallback ([ BaseController :: class , 'notFoundVendor' ]);