310 lines
No EOL
16 KiB
PHP
Executable file
310 lines
No EOL
16 KiB
PHP
Executable file
<?php
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
*/
|
|
|
|
|
|
Route::get('storage/images/{from}/{slug}', function($from = null, $slug = null) {
|
|
if ($from == 'shop'){
|
|
$image = \App\Models\UserShop::where('filename', $slug)->first();
|
|
$path = storage_path('app/public').'/images/shop'.'/'.$image->filename;
|
|
|
|
}
|
|
if (file_exists($path)) {
|
|
return Response::file($path);
|
|
}
|
|
})->name('storage_images');
|
|
|
|
Route::get('/product/image/{slug}', function($slug = null)
|
|
{
|
|
$image = \App\Models\ProductImage::where('slug', $slug)->first();
|
|
$path = storage_path('app/public').'/images/product'.'/'.$image->product_id.'/'.$image->filename;
|
|
if (file_exists($path)) {
|
|
return Response::file($path);
|
|
}
|
|
})->name('product_image');
|
|
|
|
Route::get('/user_shop/image/{slug}', function($slug = null)
|
|
{
|
|
$image = \App\Models\UserShopOnSite::where('slug', $slug)->first();
|
|
$path = storage_path('app/public').'/images/user_shop'.'/'.$image->user_shop_id.'/'.$image->filename;
|
|
if (file_exists($path)) {
|
|
return Response::file($path);
|
|
}
|
|
})->name('user_shop_image');
|
|
|
|
Route::get('/shop/product/image/{slug}', function($slug = null)
|
|
{
|
|
$image = \App\Models\ProductImage::where('slug', $slug)->first();
|
|
$path = storage_path('app/public').'/images/product'.'/'.$image->product_id.'/'.$image->filename;
|
|
if (file_exists($path)) {
|
|
return Response::file($path);
|
|
}
|
|
})->name('shop_product_image');
|
|
|
|
|
|
|
|
|
|
//main site mivita
|
|
Route::domain(config('app.pre_url_main').config('app.domain'))->group(function () {
|
|
|
|
Route::get('/datenschutz', 'HomeController@legalDataProtected')->name('datenschutz');
|
|
Route::get('/impressum', 'HomeController@legalImprint')->name('impressum');
|
|
Route::get('/datenschutz', 'HomeController@legalDataProtected')->name('data_protected');
|
|
Route::get('/impressum', 'HomeController@legalImprint')->name('imprint');
|
|
Route::get('/agb', 'HomeController@legalAGB')->name('agb');
|
|
|
|
Route::get('/kontakt', 'Web\ContactController@create')->name('contact_create');
|
|
Route::post('/kontakt', 'Web\ContactController@store')->name('contact_store');
|
|
Route::get('/', 'Web\SiteController@index')->name('/');
|
|
|
|
/* Route::get('/card/add/{id}/{quantity?}/{product_slug?}', 'Web\CardController@addToCardGet')->name('base.card_add_get');
|
|
Route::post('/card/add/{id}', 'Web\CardController@addToCardPost')->name('base.card_add_post');
|
|
Route::get('/card/show', 'Web\CardController@showCard')->name('base.card_show');
|
|
Route::get('/card/checkout', 'Web\CardController@checkoutCard')->name('base.card_checkout');
|
|
Route::post('/card/checkout_final', 'Web\CardController@checkoutFinalCard')->name('base.card_checkout_final');
|
|
Route::post('/card/update', 'Web\CardController@updateCard')->name('base.card_update');
|
|
Route::get('/card/remove/{rowId}', 'Web\CardController@removeCard')->name('base.card_remove');
|
|
Route::get('/card/delete', 'Web\CardController@deleteCard')->name('base.card_delete');*/
|
|
Route::get('/{site}/{subsite?}/{product_slug?}', 'Web\SiteController@site')->name('base.site');
|
|
|
|
});
|
|
|
|
|
|
|
|
/* ROUTING FOR CRM my.mivita / CMS*/
|
|
Route::domain(config('app.pre_url_crm').config('app.domain'))->group(function () {
|
|
|
|
Auth::routes();
|
|
Route::get('/logout', function(){
|
|
Auth::logout();
|
|
return Redirect::to('login');
|
|
})->name('logout');
|
|
|
|
Route::get('locale/{locale}', function ($locale) {
|
|
\Session::put('locale', $locale);
|
|
if(Auth::check()){
|
|
$user = Auth::user();
|
|
$user->lang = $locale;
|
|
$user->save();
|
|
}
|
|
return redirect()->back();
|
|
})->name('locale');
|
|
|
|
Route::get('/datenschutz', 'HomeController@legalDataProtected')->name('datenschutz');
|
|
Route::get('/impressum', 'HomeController@legalImprint')->name('impressum');
|
|
Route::get('/datenschutz', 'HomeController@legalDataProtected')->name('data_protected');
|
|
Route::get('/impressum', 'HomeController@legalImprint')->name('imprint');
|
|
Route::get('/agb', 'HomeController@legalAGB')->name('agb');
|
|
|
|
|
|
Route::post('/loading/modal', 'HomeController@loadingModal')->name('loading_modal');
|
|
Route::get('/', 'HomeController@index')->name('home');
|
|
|
|
|
|
Route::get('/user/update_email_confirm/{token}', 'UserUpdateEmailController@activateMail')->name('user_update_email_confirm');
|
|
Route::post('/user/check/mail', 'HomeController@checkMail')->name('user_check_mail');
|
|
|
|
Route::get('/register/verify/{confirmationCode}', 'HomeController@verify')->name('register_verify');
|
|
|
|
Route::get('/status/register', 'HomeController@statusRegister')->name('status_register');
|
|
Route::get('/status/verify', 'HomeController@statusVerify')->name('status_verify');
|
|
Route::get('/status/error', 'HomeController@statusError')->name('status_error');
|
|
Route::get('/status/not/found', 'HomeController@notFound')->name('not_found');
|
|
|
|
Route::get('/card/show', 'HomeController@index')->name('my.card_show');
|
|
Route::get('/back/to/shop/{reference?}', 'HomeController@backToShop')->name('my.back_to_shop');
|
|
|
|
|
|
Route::group(['middleware' => ['auth']], function() {
|
|
Route::get('/user_blocked', 'HomeController@blocked')->name('user_blocked');
|
|
Route::get('/wizard/{step?}', 'WizardController@show')->name('wizard');
|
|
Route::post('/wizard/store/{step?}', 'WizardController@store')->name('wizard_store');
|
|
|
|
});
|
|
|
|
|
|
Route::group(['middleware' => ['auth:user']], function()
|
|
{
|
|
|
|
Route::get('storage/{type?}/{file?}', function($type = null, $file = null)
|
|
{
|
|
if($type == 'xls'){
|
|
$path = storage_path("app/export/");
|
|
$filename = $file.'.xls';
|
|
}
|
|
|
|
if (file_exists($path.$filename)) {
|
|
return Response::download($path.$filename, $filename);
|
|
}
|
|
})->name('storage');
|
|
|
|
Route::get('/home', 'HomeController@show')->name('home');
|
|
|
|
/* Route::get('/user/edit', 'UserController@userEdit')->name('user_edit');
|
|
|
|
*/
|
|
Route::get('/user/edit', 'UserDataController@userEdit')->name('user_edit');
|
|
Route::post('/user/edit', 'UserDataController@userEditStore')->name('user_edit');
|
|
Route::post('/user/data/store', 'UserDataController@userDataStore')->name('user_data_store');
|
|
|
|
|
|
Route::get('/user/update_password', 'UserUpdatePasswordController@updatePassword')->name('user_update_password');
|
|
Route::post('/user/update_password', 'UserUpdatePasswordController@updatePasswordStore')->name('user_update_password');
|
|
|
|
Route::get('/user/update_password_first', 'UserUpdatePasswordController@updatePasswordFirst')->name('user_update_password_first');
|
|
Route::post('/user/update_password_first', 'UserUpdatePasswordController@updatePasswordFirstStore')->name('user_update_password_first');
|
|
|
|
Route::get('/user/update_email', 'UserUpdateEmailController@index')->name('user_update_email');
|
|
Route::post('/user/update_email', 'UserUpdateEmailController@update')->name('user_update_email');
|
|
|
|
Route::get('/user/delete_account', 'UserDeleteController@deleteAccount')->name('user_delete_account');
|
|
Route::post('/user/delete_account', 'UserDeleteController@deleteAccountAction')->name('user_delete_account');
|
|
|
|
Route::post('/user/data/accepted/form', 'UserDataController@userDataAcceptedForm')->name('user_data_accepted_form');
|
|
|
|
Route::get('/user/data/free', 'UserDataController@userDataFree')->name('user_data_free');
|
|
Route::post('/user/data/free/form', 'UserDataController@userDataFreeForm')->name('user_data_free_form');
|
|
|
|
Route::get('/user/shop', 'UserShopController@index')->name('user_shop');
|
|
Route::post('/user/shop/store', 'UserShopController@store')->name('user_shop_store');
|
|
Route::post('/user/shop/register/form', 'UserShopController@userShopRegisterForm')->name('user_shop_register_form');
|
|
Route::post('/user/shop/name/check', 'UserShopController@checkUserShopName')->name('user_shop_name_check');
|
|
Route::post('/user/shop/upload/image', 'UserShopController@uploadImage')->name('user_shop_upload_image');
|
|
Route::get('/user/shop/delete/image', 'UserShopController@deleteImage')->name('user_shop_delete_image');
|
|
|
|
//products images
|
|
Route::post('/user/shop_on_site/upload/image', 'UserShopController@uploadOnSiteImage')->name('user_shop_on_site_upload_image');
|
|
Route::get('/user/shop_on_site/{image_id}/{user_shop_id}', 'UserShopController@deleteOnSiteImage')->name('user_shop_on_site_delete_image');
|
|
|
|
});
|
|
|
|
Route::group(['middleware' => ['admin']], function()
|
|
{
|
|
//translate
|
|
Route::get('/admin/translate/all', 'TranslationController@index')->name('admin_translate_all');
|
|
Route::get('/admin/translate/all/edit/{lang}/{from?}', 'TranslationController@edit')->name('admin_translate_all_edit');
|
|
Route::post('/admin/translate/all/update/{lang}/{from?}', 'TranslationController@update')->name('admin_translate_all_update');
|
|
|
|
Route::get('/admin/translate/file', 'TranslationFileController@index')->name('admin_translate_file');
|
|
Route::get('/admin/translation/file/{file}/{language?}/{langsource?}/{show?}', 'TranslationFileController@edit')->name('admin_translate_file_edit');
|
|
Route::post('/admin/translation/file/{file}/{language?}/{langsource?}/{show?}', 'TranslationFileController@update')->name('admin_translate_file_update');
|
|
|
|
//products
|
|
Route::get('/admin/product/show', 'ProductController@index')->name('admin_product_show');
|
|
Route::post('/admin/product/store', 'ProductController@store')->name('admin_product_store');
|
|
Route::get('/admin/product/edit/{id}', 'ProductController@edit')->name('admin_product_edit');
|
|
Route::get('/admin/product/delete/{id}', 'ProductController@delete')->name('admin_product_delete');
|
|
//products images
|
|
Route::post('/admin/product/upload/image', 'ProductController@uploadImage')->name('admin_product_upload_image');
|
|
Route::get('/admin/product/upload/delete/{image_id}/{product_id}', 'ProductController@deleteImage')->name('admin_product_delete_image');
|
|
//products categories
|
|
Route::get('/admin/product/categories', 'CategoryController@index')->name('admin_product_categories');
|
|
Route::post('/admin/product/category/store', 'CategoryController@store')->name('admin_product_category_store');
|
|
Route::get('/admin/product/category/delete/{id}', 'CategoryController@delete')->name('admin_product_category_delete');
|
|
//products attributes
|
|
Route::get('/admin/product/attributes', 'AttributeController@index')->name('admin_product_attributes');
|
|
Route::post('/admin/product/attribute/store', 'AttributeController@store')->name('admin_product_attribute_store');
|
|
Route::get('/admin/product/attribute/delete/{id}', 'AttributeController@delete')->name('admin_product_attribute_delete');
|
|
|
|
|
|
//Route::get('/admin/products/import', 'ImportProductController@import')->name('admin_product_import');
|
|
|
|
//leads
|
|
Route::get('datatables/leads', 'DataTableController@getLeads')->name('datatables-leads');
|
|
|
|
Route::get('/admin/leads', 'LeadController@index')->name('admin_leads');
|
|
Route::get('/admin/lead/edit/{id}', 'LeadController@edit')->name('admin_lead_edit');
|
|
|
|
Route::get('/admin/lead/change_mail/{id}', 'UserUpdateEmailController@adminChangeMail')->name('admin_lead_change_mail');
|
|
Route::post('/admin/lead/change_mail/{id}', 'UserUpdateEmailController@adminUpdateMail')->name('admin_lead_change_mail');
|
|
|
|
Route::post('/admin/lead/store', 'LeadController@store')->name('admin_lead_store');
|
|
|
|
});
|
|
|
|
//login pages for superadmin
|
|
Route::group(['middleware' => ['superadmin']], function() {
|
|
//leads
|
|
Route::get('/admin/users', 'AdminUserController@index')->name('admin_users');
|
|
Route::get('/admin/user/edit/{user_id}', 'AdminUserController@edit')->name('admin_user_edit');
|
|
Route::post('/admin/user/store', 'AdminUserController@store')->name('admin_user_store');
|
|
Route::get('/admin/user/delete/{user_id}', 'AdminUserController@deleteUser')->name('admin_user_delete');
|
|
|
|
Route::get('/admin/shippings', 'ShippingController@index')->name('admin_shippings');
|
|
Route::get('/admin/shipping/edit/{shipping_id}', 'ShippingController@edit')->name('admin_shipping_edit');
|
|
Route::post('/admin/shipping/store', 'ShippingController@store')->name('admin_shipping_store');
|
|
Route::get('/admin/shipping/delete/{shipping_id}', 'ShippingController@deleteShipping')->name('admin_shipping_delete');
|
|
Route::get('/admin/shipping/price/delete/{price_id}', 'ShippingController@deletePrice')->name('admin_shipping_price_delete');
|
|
Route::get('/admin/shipping/country/delete/{price_id}', 'ShippingController@deleteCountry')->name('admin_shipping_country_delete');
|
|
|
|
Route::get('data_table', 'DataTableController@datatable')->name('data_table');
|
|
// Route::get('datatables/leads', 'DataTableController@getLeads')->name('datatables-leads');
|
|
Route::get('data/table/users', 'DataTableController@getUsers')->name('data_table_users');
|
|
});
|
|
|
|
});
|
|
|
|
/* ROUTING the checkout.mivita ... */
|
|
|
|
Route::domain(config('app.checkout_url').config('app.domain'))->group(function () {
|
|
|
|
Route::group(['middleware' => ['checkout']], function() {
|
|
|
|
Route::get('/datenschutz', 'HomeController@legalDataProtected')->name('datenschutz');
|
|
Route::get('/impressum', 'HomeController@legalImprint')->name('impressum');
|
|
Route::get('/datenschutz', 'HomeController@legalDataProtected')->name('data_protected');
|
|
Route::get('/impressum', 'HomeController@legalImprint')->name('imprint');
|
|
Route::get('/agb', 'HomeController@legalAGB')->name('agb');
|
|
|
|
|
|
Route::get('/checkout/card/{identifier?}', 'Web\CheckoutController@checkout')->name('checkout.checkout_card');
|
|
Route::post('/checkout/card/final', 'Web\CheckoutController@checkoutFinal')->name('checkout.checkout_card_final');
|
|
|
|
Route::get('/transaction/status/{status?}/{reference?}', 'Web\CheckoutController@transactionStatus')->name('checkout.transaction_status');
|
|
Route::post('/transaction/status/{status?}/{reference?}', 'Web\CheckoutController@transactionStatus')->name('checkout.transaction_status');
|
|
|
|
Route::get('/transaction/approved/{transactionId}/{reference}', 'Web\CheckoutController@transactionApproved')->name('checkout.transaction_approved');
|
|
|
|
});
|
|
});
|
|
|
|
/* ROUTING the SUBDOMAINS user.mivita ... */
|
|
|
|
Route::domain('{subdomain}.'.config('app.domain'))->group(function () {
|
|
|
|
Route::group(['middleware' => ['subdomain']], function() {
|
|
|
|
Route::get('/datenschutz', 'HomeController@legalDataProtected')->name('datenschutz');
|
|
Route::get('/impressum', 'HomeController@legalImprint')->name('impressum');
|
|
Route::get('/datenschutz', 'HomeController@legalDataProtected')->name('data_protected');
|
|
Route::get('/impressum', 'HomeController@legalImprint')->name('imprint');
|
|
Route::get('/agb', 'HomeController@legalAGB')->name('agb');
|
|
|
|
|
|
|
|
Route::get('/kontakt', 'Web\ContactController@create')->name('contact_create');
|
|
Route::post('/kontakt', 'Web\ContactController@store')->name('contact_store');
|
|
Route::get('/', 'Web\SiteController@index')->name('');
|
|
Route::get('/card/add/{id}/{quantity?}/{product_slug?}', 'Web\CardController@addToCardGet')->name('user.card_add_get');
|
|
Route::post('/card/add/{id}', 'Web\CardController@addToCardPost')->name('user.card_add_post');
|
|
Route::get('/card/show', 'Web\CardController@showCard')->name('user.card_show');
|
|
Route::get('/card/checkout/server', 'Web\CardController@checkoutServer')->name('user.card_checkout_server');
|
|
Route::post('/card/update', 'Web\CardController@updateCard')->name('user.card_update');
|
|
Route::get('/card/remove/{rowId}', 'Web\CardController@removeCard')->name('user.card_remove');
|
|
Route::get('/card/delete', 'Web\CardController@deleteCard')->name('user.card_delete');
|
|
Route::get('/back/to/shop/{reference?}', 'Web\CardController@backToShop')->name('user.back_to_shop');
|
|
Route::get('/domain/check', 'Web\SiteController@domainCheck')->name('user.domain_check');
|
|
Route::get('/{site}/{subsite?}/{product_slug?}', 'Web\SiteController@site')->name('user.site');
|
|
|
|
|
|
});
|
|
}); |