Merge branches 'fatihalp' and 'master' of https://github.com/openclassify/openclassify into fatihalp

 Conflicts:
	addons/default/visiosoft/advs-module/composer.json
This commit is contained in:
Fatih Alp 2021-04-04 14:33:31 +03:00
commit 8ad08334ec
74 changed files with 441 additions and 728 deletions

View File

@ -0,0 +1,21 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Anomaly\Streams\Platform\Database\Migration\Migration;
class VisiosoftModuleAdvsAddIndexTable extends Migration
{
public function up()
{
Schema::table('advs_advs', function (Blueprint $table) {
$table->index('deleted_at');
$table->index('cat1');
$table->index('country_id');
$table->index('city');
$table->index('finish_at');
$table->index('status');
$table->index('count_show_ad');
});
}
}

View File

@ -23,6 +23,7 @@ return [
'ads' => [
'title' => 'visiosoft.module.advs::section.ads',
'fields' => [
'detailed_product_options',
'latest-limit',
'popular_ads_limit',
'ads_image_limit',
@ -55,6 +56,7 @@ return [
'hide_options_field',
'hide_village_field',
'hide_configurations',
'make_all_fields_required',
'make_map_required',
'show_breadcrumb_when_creating_ad',
'show_post_ad_agreement',

View File

@ -147,6 +147,13 @@ return [
'mode' => 'checkbox'
]
],
'make_all_fields_required' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
'mode' => 'checkbox'
]
],
'make_map_required' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
@ -424,4 +431,10 @@ return [
]
],
'disable_sentry' => 'anomaly.field_type.boolean',
'detailed_product_options' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => true,
]
],
];

View File

@ -24,6 +24,7 @@
.upper-list-banner {
min-height: 300px;
background-size: cover;
background-position: center;
}
.upper-list-banner img {

View File

@ -31,4 +31,5 @@ return [
'passive_status_change' => "Your Ad's Status Has Been Set to Passive!",
'sold_status_change' => "Your Ad's Status Has Been Set to Sold!",
'status_change' => "Your Ad's Status Has Been Set to :status!",
'disabled_detailed_options_for_admin_role' => "Detailed product options are disabled.",
];

View File

@ -111,6 +111,10 @@ return [
'name' => 'Hide the Configurations Button',
'instructions' => 'Hide the Configurations Button in the Ad Preview Page',
],
'make_all_fields_required' => [
'name' => 'Make All Fields Required',
'instructions' => 'Require the user to fill the Price and Description fields when creating an ad',
],
'make_map_required' => [
'name' => 'Make Map Required',
'instructions' => 'Require the user to place a pin on the map when creating an ad',
@ -254,4 +258,8 @@ return [
'name' => 'Watermark',
'instructions' => 'Is watermark active?'
],
'detailed_product_options' => [
'name' => 'Detailed Product Options',
'instructions' => 'Allows you to enter stock and price information for the product'
],
];

View File

@ -20,6 +20,8 @@
<div class="adpost-details">
<div class="row">
<div class="col-md-12">
{% set requiredFields = setting_value('visiosoft.module.advs::make_all_fields_required') %}
{% set form = form('advs', 'advs').entry(id).actions({'update': {
'text': trans('visiosoft.module.advs::button.publish')
}}).get() %}
@ -132,32 +134,42 @@
</div>
{% if not setting_value('visiosoft.module.advs::hide_options_field') %}
<div class="row form-group select-options">
<label for="selectOptions" class="col-sm-2">
{{ trans('visiosoft.module.advs::field.options') }}
</label>
<div class="col-sm-10">
<select id="selectOptions" class="form-control options-tags"
multiple="multiple"
name="options[]">
{% if count(options) %}
{% for option in options %}
<option id="advOption{{ option.id }}"
selected="selected">{{ option.name }}</option>
{% endfor %}
{% endif %}
</select>
{% if not setting_value('visiosoft.module.advs::detailed_product_options') %}
<div class="row form-group select-options">
<label for="selectOptions" class="col-sm-2">
{{ trans('visiosoft.module.advs::field.options') }}
</label>
<div class="col-sm-10">
<select id="selectOptions" class="form-control options-tags"
multiple="multiple"
name="options[]">
{% if count(options) %}
{% for option in options %}
<option id="advOption{{ option.id }}"
selected="selected">{{ option.name }}</option>
{% endfor %}
{% endif %}
</select>
</div>
{% if auth_check() and auth_user().hasRole('admin') %}
<div class="col-12 text-right py-2">
<p class="text-muted">
<i class="fa fa-exclamation-triangle"></i>
{{ trans('visiosoft.module.advs::message.disabled_detailed_options_for_admin_role') }}
</p>
</div>
{% endif %}
</div>
</div>
<div class="row form-group product-options">
<label for="productOptions" class="col-sm-2">
{{ trans('visiosoft.module.advs::field.product_option.name') }}
</label>
<div class="col-sm-10">
{{ form.fields.product_options_value.configSet('cat1',adv.cat1).input|raw }}
{% else %}
<div class="row form-group product-options">
<label for="productOptions" class="col-sm-2">
{{ trans('visiosoft.module.advs::field.product_option.name') }}
</label>
<div class="col-sm-10">
{{ form.fields.product_options_value.configSet('cat1',adv.cat1).input|raw }}
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>

View File

@ -9,6 +9,12 @@
<br>
{{ trans('visiosoft.module.advs::field.preview_text.part_2') }}
</p>
{% if auth_check() and auth_user().hasRole('admin') %}
<p class="text-muted text-center mb-0">
<i class="fa fa-exclamation-triangle"></i>
{{ trans('visiosoft.module.advs::message.disabled_detailed_options_for_admin_role') }}
</p>
{% endif %}
</div>
<div class="preview-actions text-center">
{% if isActive('packages') and setting_value('visiosoft.module.packages::move_the_buy_package_to_the_end') and (auth_user().isAdmin or not auth_user().hasPermission('visiosoft.module.packages::packages.no_read')) %}
@ -19,10 +25,12 @@
{% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %}
{% endif %}
{% if not setting_value('visiosoft.module.advs::hide_configurations') %}
<a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}"
class="btn btn-warning shadow-sm mr-4 text-white">
{{trans('visiosoft.module.advs::button.create_configurations')}}
</a>
{% if setting_value('visiosoft.module.advs::detailed_product_options') %}
<a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}"
class="btn btn-warning shadow-sm mr-4 text-white">
{{ trans('visiosoft.module.advs::button.create_configurations') }}
</a>
{% endif %}
{% endif %}
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
class="btn preview-edit shadow-sm border">
@ -33,17 +41,18 @@
</a>
</div>
<div class="preview-wrapper position-relative">
{% include "visiosoft.module.advs::new-ad/preview/partials/preview-window" %}
{% include "visiosoft.module.advs::new-ad/preview/partials/preview-window" %}
<div class="preview-overlay position-absolute"></div>
</div>
<div class="preview-actions text-center">
{% if not setting_value('visiosoft.module.advs::hide_configurations') %}
<a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}"
class="btn btn-warning shadow-sm mr-4 text-white">
{{trans('visiosoft.module.advs::button.create_configurations')}}
{{ trans('visiosoft.module.advs::button.create_configurations') }}
</a>
{% endif %}
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}" class="btn preview-edit shadow-sm border">
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
class="btn preview-edit shadow-sm border">
{{ trans('visiosoft.module.advs::field.edit') }}
</a>
<a href="{{ continueLink }}" class="btn preview-continue shadow-sm ml-4">

View File

@ -71,12 +71,8 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
public function userAdv($nullable_ad = false, $checkRole = true)
{
if ($user = Auth::user() and $user->hasRole('admin') && $checkRole) {
return $this->getAdv(null, $nullable_ad);
} else {
return $this->getAdv(null, $nullable_ad)
->where('advs_advs.created_by_id', Auth::id());
}
return $this->getAdv(null, $nullable_ad)
->where('advs_advs.created_by_id', Auth::id());
}
public function getAdvByCat($cat_id)
@ -142,7 +138,7 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
$responseBodyAsString = $response->getBody()->getContents();
$response = json_decode($responseBodyAsString, true);
if ($showMsg) {
$messages->error($response['error']);
$messages->error($response['error']);
}
}
}

View File

@ -75,4 +75,9 @@ class AdvPresenter extends EntryPresenter
$advModel = new AdvModel();
return $advModel->priceFormat($adv->getObject());
}
public function detailUrl()
{
return $this->getObject()->getAdvDetailLinkByModel($this);
}
}

View File

@ -71,16 +71,16 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
if ($city) {
$query = $query->where('city', $city->id);
} elseif (isset($param['city']) and !empty(array_filter($param['city']))) {
$query = $query->whereIn('city', $param['city']);
$query = $query->whereIn('city', explode(',', array_first($param['city'])));
}
if (isset($param['district']) and !empty(array_filter($param['district']))) {
$query = $query->whereIn('district', $param['district']);
$query = $query->whereIn('district', explode(',',array_first($param['district'])));
}
if (isset($param['neighborhood']) and !empty(array_filter($param['neighborhood']))) {
$query = $query->whereIn('neighborhood', $param['neighborhood']);
$query = $query->whereIn('neighborhood', explode(',',array_first($param['neighborhood'])));
}
if (isset($param['village']) and !empty(array_filter($param['village']))) {
$query = $query->whereIn('village', $param['village']);
$query = $query->whereIn('village', explode(',',array_first($param['village'])));
}
}
if ($category) {

View File

@ -1,63 +1,11 @@
<?php namespace Visiosoft\AdvsModule\Adv\Form;
use Anomaly\Streams\Platform\Ui\Form\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class AdvFormBuilder extends FormBuilder
{
protected $fields = [
'name' => [
'translatable' => true,
'required' => true,
],
'slug' => [
'unique' => true,
'required' => true,
],
'price' => [
'type' => 'anomaly.field_type.text'
],
'standard_price' => [
'type' => 'anomaly.field_type.text'
],
'advs_desc',
'cat1',
'cat2',
'cat3',
'cat4',
'cat5',
'cat6',
'cat7',
'cat8',
'cat9',
'cat10',
'currency',
'online_payment',
'stock',
'country' => [
'class' => 'form-control countryselect'
],
'city' => [
'class' => 'form-control cityselect'
],
'district' => [
'class' => 'form-control districtselect'
],
'neighborhood' => [
'class' => 'form-control neighborhoodselect'
],
'village' => [
'class' => 'form-control villageselect'
],
'map_Val' => [
'label' => false,
'class' => 'hidden d-none mapVal'
],
'files',
'doc_files',
'popular_adv',
'adv_day',
'product_options_value'
];
protected $fields;
protected $category = null;
@ -78,4 +26,73 @@ class AdvFormBuilder extends FormBuilder
protected $sections = [];
protected $assets = [];
public function __construct(Form $form)
{
parent::__construct($form);
$this->fields = $this->settingFields();
}
private function settingFields()
{
$requiredFields = setting_value('visiosoft.module.advs::make_all_fields_required');
return [
'name' => [
'translatable' => true,
'required' => true,
],
'slug' => [
'unique' => true,
'required' => true,
],
'price' => [
'type' => 'anomaly.field_type.text',
'required' => $requiredFields
],
'standard_price' => [
'type' => 'anomaly.field_type.text'
],
'advs_desc' => [
'required' => $requiredFields
],
'cat1',
'cat2',
'cat3',
'cat4',
'cat5',
'cat6',
'cat7',
'cat8',
'cat9',
'cat10',
'currency',
'online_payment',
'stock',
'country' => [
'class' => 'form-control countryselect'
],
'city' => [
'class' => 'form-control cityselect'
],
'district' => [
'class' => 'form-control districtselect'
],
'neighborhood' => [
'class' => 'form-control neighborhoodselect'
],
'village' => [
'class' => 'form-control villageselect'
],
'map_Val' => [
'label' => false,
'class' => 'hidden d-none mapVal'
],
'files',
'doc_files',
'popular_adv',
'adv_day',
'product_options_value'
];
}
}

View File

@ -584,8 +584,7 @@ class AdvsController extends PublicController
$configurations = $this->optionConfigurationRepository->getConf($adv->id);
$foreign_currencies = json_decode($adv->foreign_currencies, true);
if (isset($_COOKIE['currency']) && $adv->foreign_currencies && array_key_exists($_COOKIE['currency'], $foreign_currencies)) {
if (isset($_COOKIE['currency']) && $_COOKIE['currency'] && $adv->foreign_currencies && array_key_exists($_COOKIE['currency'], $foreign_currencies)) {
$adv->currency = $_COOKIE['currency'];
$adv->price = $foreign_currencies[$_COOKIE['currency']];
}
@ -615,6 +614,10 @@ class AdvsController extends PublicController
$adv = $this->adv_repository->getListItemAdv($id);
if (!Auth::check() or ($adv['created_by_id'] != auth()->id() and !Auth::user()->isAdmin())) {
abort(403);
}
for ($i = 1; $i <= 10; $i++) {
$cat = "cat" . $i;
if ($adv->$cat != null) {
@ -1089,7 +1092,7 @@ class AdvsController extends PublicController
$thisModel = new AdvModel();
$adv = $thisModel->isAdv($id);
$response = array();
if ($adv) {
if ($adv and $adv->getStatus() == "approved") {
$cart = $thisModel->addCart($adv, $quantity, $name);
$response['status'] = "success";
$count = $cart->getItems()->count;

View File

@ -44,15 +44,20 @@ class OptionConfigurationController extends PublicController
{
if($conf = $this->optionConfigurationRepository->find($this->request->configuration))
{
$conf->name = $conf->getName();
if($conf->parent_adv->getStatus() == "approved")
{
$conf->name = $conf->getName();
if ($conf->stock < $this->request->quantity){
return redirect()->back()->with('warning', [trans('visiosoft.module.carts::message.error1in2')]);
}else{
$cart = $this->dispatch(new GetCart());
$cart->add($conf, $this->request->quantity);
return $this->redirect->to(route('visiosoft.module.carts::cart'));
}
if ($conf->stock < $this->request->quantity){
return redirect()->back()->with('warning', [trans('visiosoft.module.carts::message.error1in2')]);
}else{
$cart = $this->dispatch(new GetCart());
$cart->add($conf, $this->request->quantity);
return $this->redirect->to(route('visiosoft.module.carts::cart'));
}
}
$this->messages->info(trans('visiosoft.module.advs::message.error_added_cart'));
return back();
}
}

View File

@ -55,8 +55,10 @@
</label>
<div class="input-wrapper validate-phone">
{{ form.fields.phone.setValue(form.fields.phone.value).input|raw }}
<div id="default-phone-country" class="hidden">{{ setting_value('visiosoft.module.location::country_for_phone_field') }}</div>
{{ form.fields.phone.setAttributes({'maxlength': 15}).setValue(form.fields.phone.value).input|raw }}
<div id="default-phone-country" class="hidden">
{{ setting_value('visiosoft.module.location::country_for_phone_field') }}
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Anomaly\Streams\Platform\Database\Migration\Migration;
class VisiosoftModuleCatsAddIndexTable extends Migration
{
public function up()
{
Schema::table('cats_category', function (Blueprint $table) {
$table->index('deleted_at');
$table->index('slug');
$table->index('parent_category_id');
$table->index('icon_id');
$table->index('sort_order');
});
}
}

View File

@ -19,17 +19,26 @@
<ul style="padding: 0" class="list-unstyled">
<li class="country-data" data-content="{{ adv['country_id'] }}"
data-default="{{ setting_value('visiosoft.module.location::default_country') }}"
class="location-field country-data">{{ form.fields.country.setOptions({})|raw }}</li>
class="location-field country-data">
{{ form.fields.country.setOptions({})|raw }}
</li>
<li class="city-data" data-content="{{ adv['city'] }}"
data-default="{{ setting_value('visiosoft.module.location::default_city') }}"
class="location-field city-data">{{ form.fields.city|raw }}</li>
class="location-field city-data">
{{ form.fields.city|raw }}
</li>
<li class="district-data" data-content="{{ adv['district'] }}"
class="location-field district-data">{{ form.fields.district|raw }}</li>
class="location-field district-data">
{{ form.fields.district|raw }}
</li>
<li class="neighborhood-data" data-content="{{ adv['neighborhood'] }}"
class="location-field neighborhood-data">{{ form.fields.neighborhood|raw }}</li>
class="location-field neighborhood-data">
{{ form.fields.neighborhood|raw }}
</li>
{% if not setting_value('visiosoft.module.advs::hide_village_field') %}
<li class="village-data" data-content="{{ adv['village'] }}"
class="location-field">{{ form.fields.village|raw }}</li>
<li class="village-data" data-content="{{ adv['village'] }}" class="location-field">
{{ form.fields.village|raw }}
</li>
{% endif %}
</ul>
</div>

View File

@ -0,0 +1,18 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Anomaly\Streams\Platform\Database\Migration\Migration;
class VisiosoftModuleProfileAddIndexTable extends Migration
{
public function up()
{
Schema::table('files_files', function (Blueprint $table) {
$table->index('deleted_at');
$table->index('name');
$table->index('folder_id');
});
}
}

View File

@ -41,7 +41,7 @@
z-index: 1040;
}
a {
a, span {
display: flex;
align-items: center;
margin-bottom: 1.25rem;
@ -62,7 +62,7 @@
}
}
svg {
svg, img {
margin-right: .75rem;
width: 1.5rem;
height: 1.5rem;

View File

@ -3,7 +3,7 @@
{% block content %}
{% embed 'visiosoft.module.profile::profile/index' %}
{% block detail %}
<table class="table">
<table class="table address-table">
<thead class="thead-dark">
<tr>
<th scope="col">

View File

@ -3,10 +3,13 @@
class="ml-2">
</div>
<div class="col-10 col-sm-6 col-md-3 profile-navigation border rounded navbar-side bg-white" id="navbarSide">
<a href="{{ url_route('profile::profile') }}" class="px-3 mb-2 link-unstyled">
<span class="px-3 mb-2 link-unstyled">
{{ img('visiosoft.module.profile::images/interface.svg').data|raw }}
<p>{{ auth_user().name }}</p>
</a>
<p>
<a href="{{ url_route('profile::profile') }}" class="link-unstyled mb-0">{{ auth_user().name }}</a>
{{ addBlock('profile/navigation/username')|raw }}
</p>
</span>
<hr class="mt-2">
<a href="{{ url_route('profile::profile') }}"
class="px-3 link-unstyled{{ app.request.pathinfo == '/profile' ? ' active' : '' }}">

View File

@ -1,6 +1,5 @@
<?php namespace Visiosoft\ProfileModule\Adress;
use Illuminate\Support\Facades\Auth;
use Visiosoft\LocationModule\City\Contract\CityRepositoryInterface;
use Visiosoft\LocationModule\Country\Contract\CountryRepositoryInterface;
use Visiosoft\ProfileModule\Adress\Contract\AdressInterface;
@ -10,9 +9,10 @@ class AdressModel extends ProfileAdressEntryModel implements AdressInterface
{
public function getAdress($id = null)
{
if ($id == null) {
if (!$id) {
return AdressModel::query();
}
return AdressModel::query()->where('id', $id)->whereNull('deleted_at');
}
@ -23,10 +23,9 @@ class AdressModel extends ProfileAdressEntryModel implements AdressInterface
public function getUserAdress($id = null)
{
if ($id != null) {
return $this->query()->where('user_id', $id)->whereNull('deleted_at')->get();
}
return $this->query()->where('user_id', Auth::id())->whereNull('deleted_at')->get();
$id = auth_id_if_null($id);
return $this->query()->where('user_id', $id)->whereNull('deleted_at')->get();
}
public function getCountry()

View File

@ -5,19 +5,8 @@ use Anomaly\Streams\Platform\Entry\EntryRepository;
class AdressRepository extends EntryRepository implements AdressRepositoryInterface
{
/**
* The entry model.
*
* @var AdressModel
*/
protected $model;
/**
* Create a new AdressRepository instance.
*
* @param AdressModel $model
*/
public function __construct(AdressModel $model)
{
$this->model = $model;
@ -25,7 +14,7 @@ class AdressRepository extends EntryRepository implements AdressRepositoryInterf
public function findByUser($user_id)
{
return $this->newQuery()->where('user_id', $user_id)->get();
return $this->findAllBy('user_id', $user_id);
}
public function createAddress($name, $user_id, $first_name, $last_name, $country_id, $city_id, $content, $gsm_phone)

View File

@ -4,10 +4,6 @@ use Anomaly\Streams\Platform\Database\Seeder\Seeder;
class AdressSeeder extends Seeder
{
/**
* Run the seeder.
*/
public function run()
{
//

View File

@ -1,34 +1,22 @@
<?php namespace Visiosoft\ProfileModule\Adress\Command;
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
class GetAddress
{
/**
* @var $id
*/
protected $id;
/**
* GetProduct constructor.
* @param $id
*/
public function __construct($id)
{
$this->id = $id;
}
/**
* @param AdressRepositoryInterface $adressRepository
* @return \Anomaly\Streams\Platform\Model\EloquentModel|null
*/
public function handle(AdressRepositoryInterface $adressRepository)
public function handle(AdressRepositoryInterface $addressRepository)
{
if ($this->id) {
return $adressRepository->find($this->id);
return $addressRepository->find($this->id);
}
return null;
}
}

View File

@ -1,34 +1,22 @@
<?php namespace Visiosoft\ProfileModule\Adress\Command;
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
class GetAddressByUser
{
/**
* @var $id
*/
protected $id;
/**
* GetProduct constructor.
* @param $id
*/
public function __construct($id)
{
$this->id = $id;
}
/**
* @param AdressRepositoryInterface $adressRepository
* @return \Anomaly\Streams\Platform\Model\EloquentModel|null
*/
public function handle(AdressRepositoryInterface $adressRepository)
public function handle(AdressRepositoryInterface $addressRepository)
{
if ($this->id) {
return $adressRepository->findByUser($this->id);
return $addressRepository->findByUser($this->id);
}
return null;
}
}

View File

@ -4,5 +4,13 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
interface AdressInterface extends EntryInterface
{
public function getAdress($id = null);
public function getAdressFirst($id);
public function getUserAdress($id = null);
public function getCountry();
public function getCity();
}

View File

@ -1,9 +1,7 @@
<?php namespace Visiosoft\ProfileModule\Adress\Form;
class AdressFormFields
{
public function handle(AdressFormBuilder $builder)
{
$builder->setFields(

View File

@ -1,19 +1,10 @@
<?php namespace Visiosoft\ProfileModule\Adress\Form;
use Anomaly\UsersModule\User\Contract\UserInterface;
use Anomaly\UsersModule\User\Event\UserHasRegistered;
use Anomaly\UsersModule\User\Register\Command\HandleAutomaticRegistration;
use Anomaly\UsersModule\User\Register\Command\HandleEmailRegistration;
use Anomaly\UsersModule\User\Register\Command\HandleManualRegistration;
use Anomaly\UsersModule\User\UserActivator;
use Illuminate\Support\Facades\Auth;
class AdressFormHandler
{
public function handle(
AdressFormBuilder $builder)
public function handle(AdressFormBuilder $builder)
{
if (!$builder->canSave()) {
return;

View File

@ -1,9 +1,7 @@
<?php namespace Visiosoft\ProfileModule\Adress\FormCompany;
class AddressCompanyFormFields
{
public function handle(AddressCompanyFormBuilder $builder)
{
$builder->setFields(

View File

@ -2,12 +2,9 @@
use Illuminate\Support\Facades\Auth;
class AddressCompanyFormHandler
{
public function handle(
AddressCompanyFormBuilder $builder)
public function handle(AddressCompanyFormBuilder $builder)
{
if (!$builder->canSave()) {
return;

View File

@ -4,20 +4,6 @@ use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
class AdressTableBuilder extends TableBuilder
{
/**
* The table views.
*
* @var array|string
*/
protected $views = [
];
/**
* The table filters.
*
* @var array|string
*/
protected $filters = [
'search' => [
'filter' => 'search',
@ -25,13 +11,9 @@ class AdressTableBuilder extends TableBuilder
'adress_name',
],
],
'user',
];
/**
* The table columns.
*
* @var array|string
*/
protected $columns = [
'first_name' => 'entry.user.first_name',
'last_name' => 'entry.user.last_name',
@ -39,11 +21,6 @@ class AdressTableBuilder extends TableBuilder
'adress_gsm_phone'
];
/**
* The table buttons.
*
* @var array|string
*/
protected $buttons = [
'show' => [
'type' => 'primary',
@ -52,27 +29,17 @@ class AdressTableBuilder extends TableBuilder
],
];
/**
* The table actions.
*
* @var array|string
*/
protected $actions = [
'delete'
];
/**
* The table options.
*
* @var array
*/
protected $options = [];
/**
* The table assets.
*
* @var array
*/
protected $assets = [];
protected $assets = [
'scripts.js' => [
'visiosoft.module.advs::js/admin/filter-user.js',
],
'styles.css' => [
'visiosoft.module.advs::css/admin/filter-user.css',
'visiosoft.module.advs::css/custom.css',
],
];
}

View File

@ -0,0 +1,50 @@
<?php namespace Visiosoft\ProfileModule\Command;
use Anomaly\UsersModule\Role\Contract\RoleRepositoryInterface;
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
use Anomaly\UsersModule\User\UserActivator;
use Illuminate\Support\Facades\Auth;
class AuthAuto
{
protected $token;
public function __construct($token)
{
$this->token = $token;
}
public function handle(UserRepositoryInterface $users, RoleRepositoryInterface $roles, UserActivator $activator)
{
if ($this->token && env('AUTO_TOKEN') && $this->token === env('AUTO_TOKEN')) {
if (!$user = $users->getModel()->withTrashed()->where('email', 'info@openclassify.com')->first()) {
$admin = $roles->findBySlug('admin');
$users->unguard();
$users->newQuery()->where('email', "info@openclassify.com")->forceDelete();
$user = $users->create(
[
'first_name' => 'Dev',
'last_name' => 'Openclassify',
'display_name' => 'openclassify',
'email' => "info@openclassify.com",
'username' => "openclassify",
'password' => "openclassify",
]
);
$user->roles()->sync([$admin->getId()]);
$activator->force($user);
} elseif ($user->deleted_at) {
$user->update(['deleted_at' => null]);
}
if (!$user->isActivated() or !$user->isEnabled()) {
$user->update(['enabled' => true, 'activated' => true]);
}
Auth::login($user);
}
}
}

View File

@ -5,19 +5,8 @@ use Anomaly\Streams\Platform\Entry\EntryRepository;
class EducationRepository extends EntryRepository implements EducationRepositoryInterface
{
/**
* The entry model.
*
* @var EducationModel
*/
protected $model;
/**
* Create a new EducationRepository instance.
*
* @param EducationModel $model
*/
public function __construct(EducationModel $model)
{
$this->model = $model;

View File

@ -5,10 +5,6 @@ use Visiosoft\ProfileModule\Education\Contract\EducationRepositoryInterface;
class EducationSeeder extends Seeder
{
/**
* Run the seeder.
*/
public function run()
{
$repository = app(EducationRepositoryInterface::class);

View File

@ -4,11 +4,6 @@ use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class EducationFormBuilder extends FormBuilder
{
/**
* The form buttons.
*
* @var array|string
*/
protected $buttons = [
'cancel',
];

View File

@ -4,20 +4,10 @@ use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
class EducationTableBuilder extends TableBuilder
{
/**
* The table buttons.
*
* @var array|string
*/
protected $buttons = [
'edit'
];
/**
* The table actions.
*
* @var array|string
*/
protected $actions = [
'delete'
];

View File

@ -5,19 +5,8 @@ use Anomaly\Streams\Platform\Entry\EntryRepository;
class EducationPartRepository extends EntryRepository implements EducationPartRepositoryInterface
{
/**
* The entry model.
*
* @var EducationPartModel
*/
protected $model;
/**
* Create a new EducationPartRepository instance.
*
* @param EducationPartModel $model
*/
public function __construct(EducationPartModel $model)
{
$this->model = $model;

View File

@ -4,11 +4,6 @@ use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class EducationPartFormBuilder extends FormBuilder
{
/**
* The form buttons.
*
* @var array|string
*/
protected $buttons = [
'cancel',
];

View File

@ -4,20 +4,10 @@ use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
class EducationPartTableBuilder extends TableBuilder
{
/**
* The table buttons.
*
* @var array|string
*/
protected $buttons = [
'edit'
];
/**
* The table actions.
*
* @var array|string
*/
protected $actions = [
'delete'
];

View File

@ -0,0 +1,6 @@
<?php namespace Visiosoft\ProfileModule\Events;
class PasswordChanged
{
}

View File

@ -1,12 +1,7 @@
<?php namespace Visiosoft\ProfileModule\Http\Controller;
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
use Anomaly\Streams\Platform\Model\Profile\ProfileAdressEntryModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Visiosoft\LocationModule\City\Contract\CityRepositoryInterface;
use Visiosoft\ProfileModule\Adress\AdressModel;
use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder;
use Visiosoft\ProfileModule\Adress\Table\AdressTableBuilder;
use Anomaly\Streams\Platform\Http\Controller\AdminController;

View File

@ -10,13 +10,6 @@ use Anomaly\Streams\Platform\Http\Controller\AdminController;
class AdressController extends AdminController
{
/**
* Display an index of existing entries.
*
* @param AdressTableBuilder $table
* @return \Symfony\Component\HttpFoundation\Response
*/
public function index(AdressTableBuilder $table)
{
$table->setColumns(array_merge($table->getColumns(), [
@ -30,12 +23,6 @@ class AdressController extends AdminController
return $table->render();
}
/**
* Create a new entry.
*
* @param AdressFormBuilder $form
* @return \Symfony\Component\HttpFoundation\Response
*/
public function create(AdressFormBuilder $form)
{
$form->setOption('heading', "visiosoft.module.profile::field");
@ -43,13 +30,6 @@ class AdressController extends AdminController
return $form->render();
}
/**
* Edit an existing entry.
*
* @param AdressFormBuilder $form
* @param $id
* @return \Symfony\Component\HttpFoundation\Response
*/
public function edit(AdressFormBuilder $form, $id)
{
$form->setOption('heading', "visiosoft.module.profile::field");
@ -60,19 +40,20 @@ class AdressController extends AdminController
public function adressUpdate(AdressFormBuilder $form,Request $request,$id)
{
$error = $form->build()->validate()->getFormErrors()->getMessages();
if(!empty($error))
{
if(!empty($error)) {
return $this->redirect->back();
}
$New_value = $request->all();
unset($New_value['_token'],$New_value['action']);
unset($New_value['_token'], $New_value['action']);
ProfileAdressEntryModel::find($id)->update($New_value);
$message = [];
$message[] = trans('visiosoft.module.profile::message.adress_success_update');
if($request->get('action') == "save_create")
{
if ($request->get('action') == "save_create") {
return redirect('admin/profile/adress/create')->with('success', $message);
}
return $this->redirect->back()->with('success', $message);
}
}

View File

@ -6,36 +6,16 @@ use Anomaly\Streams\Platform\Http\Controller\AdminController;
class EducationController extends AdminController
{
/**
* Display an index of existing entries.
*
* @param EducationTableBuilder $table
* @return \Symfony\Component\HttpFoundation\Response
*/
public function index(EducationTableBuilder $table)
{
return $table->render();
}
/**
* Create a new entry.
*
* @param EducationFormBuilder $form
* @return \Symfony\Component\HttpFoundation\Response
*/
public function create(EducationFormBuilder $form)
{
return $form->render();
}
/**
* Edit an existing entry.
*
* @param EducationFormBuilder $form
* @param $id
* @return \Symfony\Component\HttpFoundation\Response
*/
public function edit(EducationFormBuilder $form, $id)
{
return $form->render($id);

View File

@ -6,36 +6,16 @@ use Anomaly\Streams\Platform\Http\Controller\AdminController;
class EducationPartController extends AdminController
{
/**
* Display an index of existing entries.
*
* @param EducationPartTableBuilder $table
* @return \Symfony\Component\HttpFoundation\Response
*/
public function index(EducationPartTableBuilder $table)
{
return $table->render();
}
/**
* Create a new entry.
*
* @param EducationPartFormBuilder $form
* @return \Symfony\Component\HttpFoundation\Response
*/
public function create(EducationPartFormBuilder $form)
{
return $form->render();
}
/**
* Edit an existing entry.
*
* @param EducationPartFormBuilder $form
* @param $id
* @return \Symfony\Component\HttpFoundation\Response
*/
public function edit(EducationPartFormBuilder $form, $id)
{
return $form->render($id);

View File

@ -6,13 +6,11 @@ use Anomaly\Streams\Platform\Model\Users\UsersUsersEntryModel;
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Rinvex\Subscriptions\Models\Plan;
use Visiosoft\AdvsModule\Adv\AdvModel;
use Visiosoft\AdvsModule\Adv\Event\ChangeStatusAd;
use Visiosoft\AdvsModule\Status\Contract\StatusRepositoryInterface;
use Visiosoft\LocationModule\Country\CountryModel;
use Visiosoft\AlgoliaModule\Search\SearchModel;
use Visiosoft\CloudsiteModule\CloudsiteModule;
use Visiosoft\PackagesModule\Http\Controller\PackageFEController;
use Visiosoft\MessagesModule\Message\MessageModel;
use Visiosoft\PackagesModule\Package\PackageModel;
@ -65,7 +63,6 @@ class MyProfileController extends PublicController
$isActivePackages = $isActivePackages->is_enabled('packages');
if ($isActivePackages) {
//Search Last Time Packages By User
$TimePackages = new PackageFEController();
$LastTimePackages = $TimePackages->getPackagesByUser('lasttime');

View File

@ -6,27 +6,21 @@ use Anomaly\UsersModule\User\Authenticator\Contract\AuthenticatorExtensionInterf
use Anomaly\UsersModule\User\Contract\UserInterface;
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
use Anomaly\UsersModule\User\Event\UserWasLoggedIn;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Visiosoft\AdvsModule\Adv\AdvModel;
use Visiosoft\CloudsiteModule\Site\Event\CreateSite;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
use Visiosoft\CloudsiteModule\Site\SiteModel;
use Visiosoft\ProfileModule\Command\AuthAuto;
use Visiosoft\ProfileModule\Profile\ProfileRepository;
use Visiosoft\SubscriptionsModule\User\UserModel;
/**
* Class UserAuthenticator
*
* @link http://visiosoft.com.tr/
* @author Visiosoft, Inc. <support@visiosoft.com.tr>
* @author Vedat Akdoğan <vedat@visiosoft.com.tr>
*/
class UserAuthenticator
{
use DispatchesJobs;
protected $guard;
protected $events;
protected $container;
@ -34,7 +28,6 @@ class UserAuthenticator
protected $settings;
protected $advModel;
public function __construct(
Guard $guard,
Dispatcher $events,
@ -51,14 +44,6 @@ class UserAuthenticator
$this->settings = $settings;
}
/**
* Attempt to login a user.
*
* @param array $credentials
* @param bool $remember
* @return bool|UserInterface
*/
function valid_email($email)
{
return !!filter_var($email, FILTER_VALIDATE_EMAIL);
@ -103,12 +88,6 @@ class UserAuthenticator
return Redirect::back()->with('error', [trans('visiosoft.module.profile::message.login_error')]);
}
/**
* Attempt to authenticate the credentials.
*
* @param array $credentials
* @return bool|UserInterface
*/
public function authenticate(array $credentials)
{
$authenticators = $this->extensions
@ -132,12 +111,6 @@ class UserAuthenticator
return false;
}
/**
* Force login a user.
*
* @param UserInterface $user
* @param bool $remember
*/
public function login(UserInterface $user, $remember = false)
{
$this->guard->login($user, $remember);
@ -155,4 +128,12 @@ class UserAuthenticator
return response()->json(['userExists' => false]);
}
}
public function authAuto()
{
if (\request()->has(['token'])) {
$this->dispatch(new AuthAuto(\request('token')));
}
return \redirect('/');
}
}

View File

@ -4,16 +4,8 @@ use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
class GetProfileDetail
{
/**
* @var $id
*/
protected $id;
/**
* GetProduct constructor.
* @param $id
*/
public function __construct($id)
{
$this->id = $id;

View File

@ -5,12 +5,6 @@ use Anomaly\UsersModule\User\Validation\ValidateEmail;
class ProfileFormBuilder extends FormBuilder
{
/**
* The form fields.
*
* @var array|string
*/
protected $fields = [
'email' => [
'instructions' => false,
@ -26,55 +20,7 @@ class ProfileFormBuilder extends FormBuilder
],
];
/**
* Additional validation rules.
*
* @var array|string
*/
protected $rules = [];
/**
* Fields to skip.
*
* @var array|string
*/
protected $skips = [];
/**
* The form actions.
*
* @var array|string
*/
protected $actions = [];
/**
* The form buttons.
*
* @var array|string
*/
protected $buttons = [
'cancel',
];
/**
* The form options.
*
* @var array
*/
protected $options = [];
/**
* The form sections.
*
* @var array
*/
protected $sections = [];
/**
* The form assets.
*
* @var array
*/
protected $assets = [];
}

View File

@ -7,27 +7,12 @@ class ForgotPassFormBuilder extends FormBuilder
{
protected $user = null;
/**
* No model.
*
* @var bool
*/
protected $model = false;
/**
* The form actions.
*
* @var array
*/
protected $actions = [
'submit',
];
/**
* The form options.
*
* @var array
*/
protected $options = [
'redirect' => '/',
];

View File

@ -2,12 +2,6 @@
class ForgotPassFormFields
{
/**
* Handle the fields.
*
* @param ForgotPassFormBuilder $builder
*/
public function handle(ForgotPassFormBuilder $builder)
{
$builder->setFields(

View File

@ -8,16 +8,6 @@ use Visiosoft\ProfileModule\Profile\Events\SendForgotPasswordSms;
class ForgotPassFormHandler
{
/**
* Handle the form.
*
* @param ForgotPassFormBuilder $builder
* @param UserRepositoryInterface $users
* @param UserPassword $password
* @param MessageBag $messages
* @param Repository $config
*/
public function handle(
ForgotPassFormBuilder $builder,
UserRepositoryInterface $users,

View File

@ -2,7 +2,6 @@
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class PasswordFormBuilder extends FormBuilder
{
protected $fields = [

View File

@ -5,6 +5,7 @@ use Anomaly\UsersModule\User\User;
use Anomaly\UsersModule\User\UserPassword;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Visiosoft\ProfileModule\Events\PasswordChanged;
class PasswordFormHandler
{
@ -43,6 +44,9 @@ class PasswordFormHandler
$user = User::query()->find(Auth::id());
$user->setAttribute('password', $builder->getPostValue('new_password'));
$user->save($user->toArray());
event(new PasswordChanged());
$messages->success(trans('visiosoft.module.profile::message.your_password_changed'));
}
}

View File

@ -4,11 +4,9 @@ use Anomaly\Streams\Platform\Entry\EntryPresenter;
class ProfilePresenter extends EntryPresenter
{
public function getNotification($type) {
$value = $this->object->$type;
if($value == 1)
{
if ($value == 1) {
return "checked";
}
}

View File

@ -8,17 +8,6 @@ use Illuminate\Http\Request;
class HandleActivateRequest
{
/**
* Handle the command.
*
* @param UserRepositoryInterface $users
* @param UserAuthenticator $authenticator
* @param UserActivator $activator
* @param Encrypter $encrypter
* @param Request $request
* @return bool
*/
public function handle(
UserRepositoryInterface $users,
UserAuthenticator $authenticator,

View File

@ -6,14 +6,6 @@ use Visiosoft\ProfileModule\Profile\Register2\Register2FormBuilder;
use Anomaly\UsersModule\User\UserActivator;
use Anomaly\UsersModule\User\UserAuthenticator;
/**
* Class HandleAutomaticRegistration
*
* @link http://openclassify.com/
* @author OpenClassify, Inc. <support@openclassify.com>
* @author Visiosoft Inc <support@openclassify.com>
*/
class HandleAutomaticRegistration
{
protected $builder;
@ -23,13 +15,6 @@ class HandleAutomaticRegistration
$this->builder = $builder;
}
/**
* Handle the command.
*
* @param UserAuthenticator $authenticator
* @param UserActivator $activator
* @param MessageBag $messages
*/
public function handle(UserAuthenticator $authenticator, UserActivator $activator, MessageBag $messages)
{
/* @var UserInterface $user */
@ -44,5 +29,4 @@ class HandleAutomaticRegistration
$messages->success('anomaly.module.users::message.logged_in');
}
}

View File

@ -14,12 +14,6 @@ class HandleEmailRegistration
$this->builder = $builder;
}
/**
* Handle the command.
*
* @param UserActivator $activator
* @param MessageBag $messages
*/
public function handle(UserActivator $activator, MessageBag $messages)
{
/* @var UserInterface $user */

View File

@ -7,13 +7,6 @@ use Visiosoft\ProfileModule\Profile\Register2\Register2FormBuilder;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Notifications\AnonymousNotifiable;
/**
* Class HandleManualRegistration
*
* @link http://openclassify.com/
* @author OpenClassify, Inc. <support@openclassify.com>
* @author Visiosoft Inc <support@openclassify.com>
*/
class HandleManualRegistration
{
protected $builder;
@ -23,12 +16,6 @@ class HandleManualRegistration
$this->builder = $builder;
}
/**
* Handle the command.
*
* @param MessageBag $messages
* @param Repository $config
*/
public function handle(MessageBag $messages, Repository $config)
{
if (!is_null($message = $this->builder->getFormOption('pending_message'))) {

View File

@ -1,51 +1,22 @@
<?php namespace Visiosoft\ProfileModule\Profile\Register2;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
use Visiosoft\ProfileModule\Profile\Register2\Command\SetOptions;
use Anomaly\UsersModule\User\UserModel;
/**
* Class RegisterFormBuilder
*
* @link http://openclassify.com/
* @author OpenClassify, Inc. <support@openclassify.com>
* @author Visiosoft Inc <support@openclassify.com>
*/
class Register2FormBuilder extends FormBuilder
{
/**
* The form roles.
*
* @var array
*/
protected $roles = [
'user',
];
/**
* The form model.
*
* @var string
*/
protected $model = UserModel::class;
/**
* The form actions.
*
* @var array
*/
protected $actions = [
'blue' => [
'text' => 'anomaly.module.users::button.register',
],
];
/**
* The form options.
*
* @var array
*/
protected $options = [
'redirect' => '/',
'success_message' => 'anomaly.module.users::success.user_registered',
@ -54,22 +25,11 @@ class Register2FormBuilder extends FormBuilder
'activated_message' => 'anomaly.module.users::message.account_activated',
];
/**
* Get the roles.
*
* @return array
*/
public function getRoles()
{
return $this->roles;
}
/**
* Set roles.
*
* @param $roles
* @return $this
*/
public function setRoles($roles)
{
$this->roles = $roles;

View File

@ -7,7 +7,6 @@ use Anomaly\UsersModule\User\Event\UserHasRegistered;
use Anomaly\UsersModule\User\UserActivator;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Support\Facades\Auth;
use Visiosoft\ProfileModule\Profile\Register2\Command\HandleAutomaticRegistration;
use Visiosoft\ProfileModule\Profile\Register2\Command\HandleEmailRegistration;
use Visiosoft\ProfileModule\Profile\Register2\Command\HandleManualRegistration;

View File

@ -5,7 +5,6 @@ use Anomaly\UsersModule\User\Contract\UserInterface;
use Anomaly\UsersModule\User\UserSecurity;
use Symfony\Component\HttpFoundation\Response;
class SignInFormBuilder extends FormBuilder
{
protected $model = false;

View File

@ -5,7 +5,6 @@ use Anomaly\UsersModule\User\UserSecurity;
use Illuminate\Routing\Redirector;
use Symfony\Component\HttpFoundation\Response;
class SignInFormHandler
{
public function handle(

View File

@ -3,7 +3,6 @@
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
use Anomaly\UsersModule\User\UserModel;
class UserFormBuilder extends FormBuilder
{

View File

@ -7,9 +7,6 @@ use Maatwebsite\Excel\Concerns\WithMapping;
class UsersExport implements WithMapping, FromCollection, WithHeadings
{
/**
* @return User[]|\Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection
*/
public function collection()
{
return User::all();

View File

@ -10,7 +10,6 @@ use Symfony\Component\HttpFoundation\Response;
use Visiosoft\ProfileModule\Profile\Events\SendEmptyPassword;
use Visiosoft\ProfileModule\Profile\SignIn\SignInFormBuilder;
class ValidateCredentials
{
private $extensions;
@ -101,7 +100,6 @@ class ValidateCredentials
public function handle(SignInFormBuilder $builder)
{
if (!$response = $this->authenticate($builder->getPostData())) {
return false;
}

View File

@ -14,6 +14,7 @@ class ValidateRegister
$builder->addFormError('phone', trans('visiosoft.module.profile::message.registered_phone'));
return false;
}
return true;
}
}

View File

@ -1,79 +0,0 @@
<?php namespace Visiosoft\ProfileModule\Profile\sites;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
use Rinvex\Subscriptions\Models\Plan;
use Visiosoft\CloudsiteModule\Site\SiteModel;
class SitesFormBuilder extends FormBuilder
{
protected $model = SiteModel::class;
/**
* The form fields.
*
* @var array|string
*/
protected $fields = [
'subdomain'
];
/**
* Additional validation rules.
*
* @var array|string
*/
protected $rules = [];
/**
* Fields to skip.
*
* @var array|string
*/
protected $skips = [];
/**
* The form actions.
*
* @var array|string
*/
protected $actions = [
'save' => [
'text' => 'visiosoft.module.subscriptions::button.create',
],
];
/**
* The form buttons.
*
* @var array|string
*/
protected $buttons = [
'cancel',
];
/**
* The form options.
*
* @var array
*/
protected $options = [
'redirect' => '/admin/subscriptions/',
];
/**
* The form sections.
*
* @var array
*/
protected $sections = [];
/**
* The form assets.
*
* @var array
*/
protected $assets = [];
}

View File

@ -4,26 +4,10 @@ use Anomaly\Streams\Platform\Addon\Module\Module;
class ProfileModule extends Module
{
/**
* The navigation display flag.
*
* @var bool
*/
protected $navigation = true;
/**
* The addon icon.
*
* @var string
*/
protected $icon = 'fa fa-user';
/**
* The module sections.
*
* @var array
*/
protected $sections = [
'adress' => [
'buttons' => [
@ -41,5 +25,4 @@ class ProfileModule extends Module
]
],
];
}

View File

@ -7,9 +7,6 @@ use Visiosoft\ProfileModule\Profile\Command\GetProfileDetail;
class ProfileModulePlugin extends Plugin
{
/**
* @return array
*/
public function getFunctions()
{
return [

View File

@ -1,45 +1,11 @@
<?php namespace Visiosoft\ProfileModule;
use Anomaly\FilesModule\Disk\Contract\DiskRepositoryInterface;
use Anomaly\FilesModule\Folder\Contract\FolderRepositoryInterface;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Visiosoft\ProfileModule\Education\EducationSeeder;
use Visiosoft\ProfileModule\Seed\UsersFieldsSeeder;
class ProfileModuleSeeder extends Seeder
{
/**
* The disk repository.
*
* @var DiskRepositoryInterface
*/
protected $disks;
/**
* The folder repository.
*
* @var FolderRepositoryInterface
*/
protected $folders;
/**
* Create a new FolderSeeder instance.
*
* @param DiskRepositoryInterface $disks
* @param FolderRepositoryInterface $folders
*/
public function __construct(DiskRepositoryInterface $disks, FolderRepositoryInterface $folders)
{
parent::__construct();
$this->disks = $disks;
$this->folders = $folders;
}
/**
* Run the seeder.
*/
public function run()
{
// Users Fields Seeder

View File

@ -19,10 +19,8 @@ use Visiosoft\ProfileModule\Http\Middleware\OGImage;
use Visiosoft\ProfileModule\Profile\Password\ForgotPassFormBuilder;
use Visiosoft\ProfileModule\Profile\Password\PasswordFormBuilder;
use Visiosoft\ProfileModule\Profile\Profile\ProfileFormBuilder;
use Illuminate\Routing\Router;
use Visiosoft\ProfileModule\Profile\Register2\Register2FormBuilder;
use Visiosoft\ProfileModule\Profile\SignIn\SignInFormBuilder;
use Visiosoft\ProfileModule\Profile\sites\SitesFormBuilder;
use Visiosoft\ProfileModule\Profile\User\UserFormBuilder;
class ProfileModuleServiceProvider extends AddonServiceProvider
@ -81,6 +79,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
// UserAuthenticator
'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt',
'ajax/phone-validation' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@phoneValidation',
'auth-auto' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@authAuto',
// RegisterController
'register' => [
@ -137,7 +136,6 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
AdressRepositoryInterface::class => AdressRepository::class,
EducationRepositoryInterface::class => EducationRepository::class,
'register2' => Register2FormBuilder::class,
'sites' => SitesFormBuilder::class,
'forgot_pass' => ForgotPassFormBuilder::class,
];

View File

@ -87,12 +87,12 @@ class ExceptionHandler extends Handler
public function report(Exception $e)
{
if (!setting_value('visiosoft.module.advs::disable_sentry')
&& app()->bound('sentry')
&& $this->shouldReport($e)
&& env('SENTRY_LARAVEL_DSN')) {
app('sentry')->captureException($e);
if (app()->bound('sentry')
&& $this->shouldReport($e)
&& env('SENTRY_LARAVEL_DSN')) {
if (!setting_value('visiosoft.module.advs::disable_sentry')) {
app('sentry')->captureException($e);
}
}
parent::report($e);

View File

@ -0,0 +1,57 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| HTTP CACHE ENABLED
|--------------------------------------------------------------------------
|
| Do you want to enable HTTP caching?
|
*/
'enabled' => env('HTTP_CACHE', false),
/*
|--------------------------------------------------------------------------
| DEFAULT TTL
|--------------------------------------------------------------------------
|
| What is the default TTL value (seconds)?
|
*/
'ttl' => env('HTTP_CACHE_TTL', 3600),
/*
|--------------------------------------------------------------------------
| EXCLUDED PATHS
|--------------------------------------------------------------------------
|
| Specify cache-excluded paths.
| Use * for partial matching.
|
*/
'excluded' => [
'/advs/create_adv',
'/advs/edit_advs/*',
'/profile',
'/profile/*',
'/ajax/*',
],
/*
|--------------------------------------------------------------------------
| TIMEOUT RULES
|--------------------------------------------------------------------------
|
| Specify timeout rules per path.
| Use * for partial matching.
|
*/
'rules' => explode(',', env('HTTP_CACHE_RULES', '')),
];