v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@@ -2,10 +2,9 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Schema;
use Illuminate\Support\ServiceProvider as Provider;
class AppServiceProvider extends ServiceProvider
class App extends Provider
{
/**
* Bootstrap any application services.
@@ -15,7 +14,9 @@ class AppServiceProvider extends ServiceProvider
public function boot()
{
// Laravel db fix
Schema::defaultStringLength(191);
\Schema::defaultStringLength(191);
\Blade::withoutDoubleEncoding();
}
/**

View File

@@ -2,10 +2,10 @@
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as Provider;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
class Auth extends Provider
{
/**
* The policy mappings for the application.
@@ -13,7 +13,7 @@ class AuthServiceProvider extends ServiceProvider
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
//'App\Model' => 'App\Policies\ModelPolicy',
];
/**

34
app/Providers/Blade.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
namespace App\Providers;
use App\Traits\DateTime;
use Illuminate\Support\Facades\Blade as Facade;
use Illuminate\Support\ServiceProvider;
class Blade extends ServiceProvider
{
use DateTime;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Facade::directive('date', function ($expression) {
return "<?php echo company_date($expression); ?>";
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -2,10 +2,10 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\Facades\Broadcast as Facade;
use Illuminate\Support\ServiceProvider as Provider;
class BroadcastServiceProvider extends ServiceProvider
class Broadcast extends Provider
{
/**
* Bootstrap any application services.

95
app/Providers/Event.php Normal file
View File

@@ -0,0 +1,95 @@
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as Provider;
class Event extends Provider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
'App\Events\Install\UpdateFinished' => [
'App\Listeners\Update\V10\Version106',
'App\Listeners\Update\V10\Version107',
'App\Listeners\Update\V10\Version108',
'App\Listeners\Update\V10\Version109',
'App\Listeners\Update\V11\Version110',
'App\Listeners\Update\V11\Version112',
'App\Listeners\Update\V11\Version113',
'App\Listeners\Update\V11\Version119',
'App\Listeners\Update\V12\Version120',
'App\Listeners\Update\V12\Version126',
'App\Listeners\Update\V12\Version127',
'App\Listeners\Update\V12\Version129',
'App\Listeners\Update\V12\Version1210',
'App\Listeners\Update\V12\Version1211',
'App\Listeners\Update\V13\Version130',
'App\Listeners\Update\V13\Version132',
'App\Listeners\Update\V13\Version135',
'App\Listeners\Update\V13\Version138',
'App\Listeners\Update\V13\Version139',
'App\Listeners\Update\V13\Version1311',
'App\Listeners\Update\V13\Version1313',
'App\Listeners\Update\V13\Version1316',
'App\Listeners\Update\V20\Version200',
],
'Illuminate\Auth\Events\Login' => [
'App\Listeners\Auth\Login',
],
'Illuminate\Auth\Events\Logout' => [
'App\Listeners\Auth\Logout',
],
'App\Events\Expense\BillCreated' => [
'App\Listeners\Expense\CreateBillCreatedHistory',
],
'App\Events\Expense\BillRecurring' => [
'App\Listeners\Expense\SendBillRecurringNotification',
],
'App\Events\Income\PaymentReceived' => [
'App\Listeners\Income\CreateInvoiceTransaction',
'App\Listeners\Income\SendInvoicePaymentNotification',
],
'App\Events\Income\InvoiceCreated' => [
'App\Listeners\Income\CreateInvoiceCreatedHistory',
'App\Listeners\Income\IncreaseNextInvoiceNumber',
],
'App\Events\Income\InvoiceSent' => [
'App\Listeners\Income\MarkInvoiceSent',
],
'App\Events\Income\InvoiceViewed' => [
'App\Listeners\Income\MarkInvoiceViewed',
],
'App\Events\Income\InvoiceRecurring' => [
'App\Listeners\Income\SendInvoiceRecurringNotification',
],
];
/**
* The subscriber classes to register.
*
* @var array
*/
protected $subscribe = [
'App\Listeners\Common\IncomeSummaryReport',
'App\Listeners\Common\ExpenseSummaryReport',
'App\Listeners\Common\IncomeExpenseSummaryReport',
'App\Listeners\Common\TaxSummaryReport',
'App\Listeners\Common\ProfitLossReport',
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
parent::boot();
//
}
}

View File

@@ -1,62 +0,0 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Event;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
'App\Events\UpdateFinished' => [
'App\Listeners\Updates\V10\Version106',
'App\Listeners\Updates\V10\Version107',
'App\Listeners\Updates\V10\Version108',
'App\Listeners\Updates\V10\Version109',
'App\Listeners\Updates\V11\Version110',
'App\Listeners\Updates\V11\Version112',
'App\Listeners\Updates\V11\Version113',
'App\Listeners\Updates\V11\Version119',
'App\Listeners\Updates\V12\Version120',
'App\Listeners\Updates\V12\Version126',
'App\Listeners\Updates\V12\Version127',
'App\Listeners\Updates\V12\Version129',
'App\Listeners\Updates\V12\Version1210',
'App\Listeners\Updates\V12\Version1211',
'App\Listeners\Updates\V13\Version130',
'App\Listeners\Updates\V13\Version132',
'App\Listeners\Updates\V13\Version135',
'App\Listeners\Updates\V13\Version138',
'App\Listeners\Updates\V13\Version139',
'App\Listeners\Updates\V13\Version1311',
'App\Listeners\Updates\V13\Version1313',
'App\Listeners\Updates\V13\Version1316',
],
'Illuminate\Auth\Events\Login' => [
'App\Listeners\Auth\Login',
],
'Illuminate\Auth\Events\Logout' => [
'App\Listeners\Auth\Logout',
],
'App\Events\InvoicePaid' => [
'App\Listeners\Incomes\Invoice\Paid',
],
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
parent::boot();
//
}
}

136
app/Providers/Form.php Normal file
View File

@@ -0,0 +1,136 @@
<?php
namespace App\Providers;
use Form as Facade;
use Illuminate\Support\ServiceProvider as Provider;
class Form extends Provider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
// Form components
Facade::component('aliasGroup', 'partials.form.alias_group', [
'original', 'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('moneyGroup', 'partials.form.money_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('dateGroup', 'partials.form.date_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('textGroup', 'partials.form.text_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('emailGroup', 'partials.form.email_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('passwordGroup', 'partials.form.password_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('numberGroup', 'partials.form.number_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('multiSelectGroup', 'partials.form.multi_select_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('multiSelectAddNewGroup', 'partials.form.multi_select_add_new_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('selectGroup', 'partials.form.select_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('selectAddNewGroup', 'partials.form.select_add_new_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required', 'path' => ''], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('selectGroupGroup', 'partials.form.select_group_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('selectGroupAddNewGroup', 'partials.form.select_group_add_new_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('textareaGroup', 'partials.form.textarea_group', [
'name', 'text', 'icon', 'value' => null, 'attributes' => ['rows' => '3'], 'col' => 'col-md-12', 'group_class' => null
]);
Facade::component('radioGroup', 'partials.form.radio_group', [
'name', 'text', 'value' => null, 'enable' => trans('general.yes'), 'disable' => trans('general.no'), 'attributes' => [], 'col' => 'col-md-6',
]);
Facade::component('checkboxGroup', 'partials.form.checkbox_group', [
'name', 'text', 'items' => [], 'value' => 'name', 'id' => 'id', 'attributes' => ['required' => 'required'], 'col' => 'col-md-12',
]);
Facade::component('fileGroup', 'partials.form.file_group', [
'name', 'text', 'icon', 'attributes' => [], 'value' => null, 'col' => 'col-md-6',
]);
Facade::component('deleteButton', 'partials.form.delete_button', [
'item', 'url', 'text' => '', 'value' => 'name', 'id' => 'id',
]);
Facade::component('deleteLink', 'partials.form.delete_link', [
'item', 'url', 'text' => '', 'value' => 'name', 'id' => 'id',
]);
Facade::component('saveButtons', 'partials.form.save_buttons', [
'cancel', 'col' => 'col-md-12',
]);
Facade::component('recurring', 'partials.form.recurring', [
'page', 'model' => null,
]);
Facade::component('invoice_text', 'partials.form.invoice_text', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'input_name', 'input_value', 'col' => 'col-md-6', 'group_class' => null
]);
Facade::component('dateRange', 'partials.form.date_range', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Facade::component('bulkActionRowGroup', 'partials.form.bulk_action_row_group', [
'text', 'actions', 'path'
]);
Facade::component('bulkActionAllGroup', 'partials.form.bulk_action_all_group', [
]);
Facade::component('bulkActionGroup', 'partials.form.bulk_action_group', [
'id', 'name'
]);
Facade::component('enabledGroup', 'partials.form.enabled_group', [
'id', 'name', 'value'
]);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -1,88 +0,0 @@
<?php
namespace App\Providers;
use Form;
use Illuminate\Support\ServiceProvider;
class FormServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
// Form components
Form::component('textGroup', 'partials.form.text_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('emailGroup', 'partials.form.email_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('passwordGroup', 'partials.form.password_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('numberGroup', 'partials.form.number_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('selectGroup', 'partials.form.select_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6',
]);
Form::component('textareaGroup', 'partials.form.textarea_group', [
'name', 'text', 'value' => null, 'attributes' => ['rows' => '3'], 'col' => 'col-md-12',
]);
Form::component('radioGroup', 'partials.form.radio_group', [
'name', 'text', 'enable' => trans('general.yes'), 'disable' => trans('general.no'), 'attributes' => [], 'col' => 'col-md-6',
]);
Form::component('checkboxGroup', 'partials.form.checkbox_group', [
'name', 'text', 'items' => [], 'value' => 'name', 'id' => 'id', 'attributes' => ['required' => 'required'], 'col' => 'col-md-12',
]);
Form::component('fileGroup', 'partials.form.file_group', [
'name', 'text', 'attributes' => [], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('deleteButton', 'partials.form.delete_button', [
'item', 'url', 'text' => '', 'value' => 'name', 'id' => 'id',
]);
Form::component('deleteLink', 'partials.form.delete_link', [
'item', 'url', 'text' => '', 'value' => 'name', 'id' => 'id',
]);
Form::component('saveButtons', 'partials.form.save_buttons', [
'cancel', 'col' => 'col-md-12',
]);
Form::component('recurring', 'partials.form.recurring', [
'page', 'model' => null,
]);
Form::component('invoice_text', 'partials.form.invoice_text', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'input_name', 'input_value', 'col' => 'col-md-6',
]);
Form::component('dateRange', 'partials.form.date_range', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -2,10 +2,12 @@
namespace App\Providers;
use App\Models\Auth\User;
use App\Models\Banking\Transaction;
use App\Models\Common\Company;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\ServiceProvider as Provider;
class ObserverServiceProvider extends ServiceProvider
class Observer extends Provider
{
/**
* Register bindings in the container.
@@ -14,8 +16,9 @@ class ObserverServiceProvider extends ServiceProvider
*/
public function boot()
{
// Observe company actions
User::observe('App\Observers\User');
Company::observe('App\Observers\Company');
Transaction::observe('App\Observers\Transaction');
}
/**
@@ -27,4 +30,4 @@ class ObserverServiceProvider extends ServiceProvider
{
//
}
}
}

172
app/Providers/Route.php Normal file
View File

@@ -0,0 +1,172 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route as Facade;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as Provider;
class Route extends Provider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapInstallRoutes();
$this->mapApiRoutes();
$this->mapCommonRoutes();
$this->mapGuestRoutes();
$this->mapWizardRoutes();
$this->mapAdminRoutes();
$this->mapPortalRoutes();
$this->mapSignedRoutes();
//
}
/**
* Define the "install" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapInstallRoutes()
{
Facade::prefix('install')
->middleware('install')
->namespace($this->namespace)
->group(base_path('routes/install.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Facade::prefix('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
/**
* Define the "common" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapCommonRoutes()
{
Facade::middleware('common')
->namespace($this->namespace)
->group(base_path('routes/common.php'));
}
/**
* Define the "guest" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapGuestRoutes()
{
Facade::middleware('guest')
->namespace($this->namespace)
->group(base_path('routes/guest.php'));
}
/**
* Define the "wizard" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWizardRoutes()
{
Facade::prefix('wizard')
->middleware('wizard')
->namespace($this->namespace)
->group(base_path('routes/wizard.php'));
}
/**
* Define the "admin" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapAdminRoutes()
{
Facade::middleware('admin')
->namespace($this->namespace)
->group(base_path('routes/admin.php'));
}
/**
* Define the "portal" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapPortalRoutes()
{
Facade::prefix('portal')
->middleware('portal')
->namespace($this->namespace)
->group(base_path('routes/portal.php'));
}
/**
* Define the "signed" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapSignedRoutes()
{
Facade::prefix('signed')
->middleware('signed')
->namespace($this->namespace)
->group(base_path('routes/signed.php'));
}
}

View File

@@ -1,90 +0,0 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
$this->mapSignedRoutes();
//
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
/**
* Define the "signed" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapSignedRoutes()
{
Route::prefix('signed')
->middleware('signed')
->namespace($this->namespace)
->group(base_path('routes/signed.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}

View File

@@ -3,10 +3,10 @@
namespace App\Providers;
use App\Models\Setting\Currency;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\ServiceProvider as Provider;
use Validator;
class ValidationServiceProvider extends ServiceProvider
class Validation extends Provider
{
/**
* Bootstrap any application services.
@@ -19,7 +19,7 @@ class ValidationServiceProvider extends ServiceProvider
Validator::extend('currency', function ($attribute, $value, $parameters, $validator) use(&$currency_code) {
$status = false;
if (!is_string($value) || (strlen($value) != 3)) {
return $status;
}

View File

@@ -2,10 +2,10 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\ServiceProvider as Provider;
use View;
class ViewComposerServiceProvider extends ServiceProvider
class ViewComposer extends Provider
{
/**
* Register bindings in the container.
@@ -14,14 +14,9 @@ class ViewComposerServiceProvider extends ServiceProvider
*/
public function boot()
{
// All
View::composer(
'*', 'App\Http\ViewComposers\All'
);
// Suggestions
View::composer(
['partials.admin.content'], 'App\Http\ViewComposers\Suggestions'
['partials.admin.header'], 'App\Http\ViewComposers\Suggestions'
);
// Notifications
@@ -31,19 +26,24 @@ class ViewComposerServiceProvider extends ServiceProvider
// Add company info to menu
View::composer(
['partials.admin.menu', 'partials.customer.menu'], 'App\Http\ViewComposers\Menu'
['partials.admin.menu', 'partials.portal.menu'], 'App\Http\ViewComposers\Menu'
);
// Add notifications to header
View::composer(
['partials.wizard.header', 'partials.admin.header', 'partials.customer.header'], 'App\Http\ViewComposers\Header'
['partials.wizard.navbar', 'partials.admin.navbar', 'partials.portal.navbar'], 'App\Http\ViewComposers\Header'
);
// Add limits to index
// Add limits and bulk actions to index
View::composer(
'*.index', 'App\Http\ViewComposers\Index'
);
// Add limits to show
View::composer(
'*.show', 'App\Http\ViewComposers\Index'
);
// Add Modules
View::composer(
'modules.*', 'App\Http\ViewComposers\Modules'
@@ -61,7 +61,7 @@ class ViewComposerServiceProvider extends ServiceProvider
// Add Invoice Text
View::composer(
['incomes.invoices.*', 'customers.invoices.*'], 'App\Http\ViewComposers\InvoiceText'
['incomes.invoices.*', 'portal.invoices.*'], 'App\Http\ViewComposers\InvoiceText'
);
}