This commit is contained in:
vedatakd 2019-08-05 18:24:40 +03:00
parent b7e4f8aa43
commit 78eb278d7d
4 changed files with 55 additions and 19 deletions

View File

@ -107,6 +107,11 @@ Then run the installer and indicate that the system is ready to install:
php artisan install --ready php artisan install --ready
``` ```
## Install Cors
php artisan vendor:publish --provider="Barryvdh\Cors\ServiceProvider"
## Development Team ## Development Team
Vedat Akdoğan @vedatakd Vedat Akdoğan @vedatakd

View File

@ -1,9 +1,12 @@
{ {
"name": "visiosoft/profile-module", "name": "visiosoft/profile-module",
"type": "streams-addon", "type": "streams-addon",
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Visiosoft\\ProfileModule\\": "src/" "Visiosoft\\ProfileModule\\": "src/"
}
} }
},
"require": {
"barryvdh/laravel-cors": "^0.11.3"
}
} }

View File

@ -1,6 +1,7 @@
<?php namespace Visiosoft\ProfileModule; <?php namespace Visiosoft\ProfileModule;
use Anomaly\Streams\Platform\Addon\AddonServiceProvider; use Anomaly\Streams\Platform\Addon\AddonServiceProvider;
use Barryvdh\Cors\ServiceProvider;
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface; use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
use Visiosoft\ProfileModule\Adress\AdressRepository; use Visiosoft\ProfileModule\Adress\AdressRepository;
use Anomaly\Streams\Platform\Model\Profile\ProfileAdressEntryModel; use Anomaly\Streams\Platform\Model\Profile\ProfileAdressEntryModel;
@ -50,22 +51,22 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
* @type array|null * @type array|null
*/ */
protected $routes = [ protected $routes = [
'admin/profile/adress' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@index', 'admin/profile/adress' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@index',
'admin/profile/adress/create' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@create', 'admin/profile/adress/create' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@create',
'admin/profile/adress/edit/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@adresList', 'admin/profile/adress/edit/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@adresList',
'admin/profile/adress/editAdress/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@edit', 'admin/profile/adress/editAdress/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@edit',
'admin/profile/adress/update/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@adressupdate', 'admin/profile/adress/update/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\AdressController@adressupdate',
'admin/profile' => 'Visiosoft\ProfileModule\Http\Controller\Admin\ProfileController@index', 'admin/profile' => 'Visiosoft\ProfileModule\Http\Controller\Admin\ProfileController@index',
'admin/profile/edit/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\ProfileController@edit', 'admin/profile/edit/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\ProfileController@edit',
'admin/profile/update/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\ProfileController@update', 'admin/profile/update/{id}' => 'Visiosoft\ProfileModule\Http\Controller\Admin\ProfileController@update',
'profile/edit' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@edit', 'profile/edit' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@edit',
'profile/update' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@update', 'profile/update' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@update',
'profile' => [ 'profile' => [
'as' => 'visiosoft.module.profile::profile', 'as' => 'visiosoft.module.profile::profile',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@home' 'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@home'
], ],
'profile/adress' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressList', 'profile/adress' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressList',
'profile/adress/edit/{id}' => [ 'profile/adress/edit/{id}' => [
'as' => 'visiosoft.module.profile::address_edit', 'as' => 'visiosoft.module.profile::address_edit',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressEdit' 'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressEdit'
], ],
@ -74,15 +75,15 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
'profile/class/extendTime/{id},{type}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@extendAds', 'profile/class/extendTime/{id},{type}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@extendAds',
'profile/message/show/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@showMessage', 'profile/message/show/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@showMessage',
'profile/closeAccount' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@disableAccount', 'profile/closeAccount' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@disableAccount',
'profile/adress/create' => [ 'profile/adress/create' => [
'as' => 'visiosoft.module.profile::adress_create', 'as' => 'visiosoft.module.profile::adress_create',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressCreate' 'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressCreate'
], ],
'profile/adress/ajaxCreate' => [ 'profile/adress/ajaxCreate' => [
'as' => 'visiosoft.module.profile::adress_ajax_create', 'as' => 'visiosoft.module.profile::adress_ajax_create',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressAjaxCreate' 'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressAjaxCreate'
], ],
'profile/order/{id}' => [ 'profile/order/{id}' => [
'as' => 'visiosoft.module.profile::profile_order', 'as' => 'visiosoft.module.profile::profile_order',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@orderDetail' 'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@orderDetail'
], ],
@ -92,10 +93,15 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
'profile/orders/not-delivered-purchase/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@orderNotDelivered', 'profile/orders/not-delivered-purchase/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@orderNotDelivered',
'profile/orders/report-sales' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@reportSales', 'profile/orders/report-sales' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@reportSales',
'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt', 'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt',
'profile/notification' => [ 'profile/notification' => [
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@notification', 'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@notification',
], ],
'register/ajax' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@registerAjax', 'register/ajax' => [
'uses' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@registerAjax',
'middleware' => [
\Barryvdh\Cors\HandleCors::class,
]
]
]; ];
@ -164,8 +170,8 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
protected $singletons = [ protected $singletons = [
AdressRepositoryInterface::class => AdressRepository::class, AdressRepositoryInterface::class => AdressRepository::class,
ProfileRepositoryInterface::class => ProfileRepository::class, ProfileRepositoryInterface::class => ProfileRepository::class,
'register2' => Register2FormBuilder::class, 'register2' => Register2FormBuilder::class,
'sites' => SitesFormBuilder::class, 'sites' => SitesFormBuilder::class,
]; ];
/** /**
@ -174,7 +180,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
* @type array|null * @type array|null
*/ */
protected $providers = [ protected $providers = [
//\ExamplePackage\Provider\ExampleProvider::class ServiceProvider::class,
]; ];
/** /**

22
config/cors.php Normal file
View File

@ -0,0 +1,22 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Laravel CORS
|--------------------------------------------------------------------------
|
| allowedOrigins, allowedHeaders and allowedMethods can be set to array('*')
| to accept any value.
|
*/
'supportsCredentials' => false,
'allowedOrigins' => ['*'],// ex: ['abc.com', 'api.abc.com']
'allowedHeaders' => ['*'],
'allowedMethods' => ['*'],// ex: ['GET', 'POST', 'PUT', 'DELETE']
'exposedHeaders' => [],
'maxAge' => 0,
];