started l7

This commit is contained in:
denisdulici 2020-03-04 11:09:28 +03:00
parent 29483d8c0a
commit 03cf280063
30 changed files with 195 additions and 120 deletions

View File

@ -20,7 +20,7 @@ SESSION_DRIVER=file
QUEUE_CONNECTION=sync QUEUE_CONNECTION=sync
LOG_CHANNEL=stack LOG_CHANNEL=stack
MAIL_DRIVER=mail MAIL_MAILER=mail
MAIL_HOST=localhost MAIL_HOST=localhost
MAIL_PORT=2525 MAIL_PORT=2525
MAIL_USERNAME=null MAIL_USERNAME=null

View File

@ -16,7 +16,7 @@ SESSION_DRIVER=file
QUEUE_CONNECTION=sync QUEUE_CONNECTION=sync
LOG_CHANNEL=stack LOG_CHANNEL=stack
MAIL_DRIVER=log MAIL_MAILER=log
MAIL_HOST=localhost MAIL_HOST=localhost
MAIL_PORT=2525 MAIL_PORT=2525
MAIL_USERNAME=null MAIL_USERNAME=null

View File

@ -27,7 +27,7 @@
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller... # Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L] RewriteRule ^ index.php [L]

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route;
Route::group([ Route::group([
'middleware' => 'admin', 'middleware' => 'admin',
'namespace' => 'Modules\$STUDLY_NAME$\Http\Controllers' 'namespace' => 'Modules\$STUDLY_NAME$\Http\Controllers'

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route;
Route::group([ Route::group([
'prefix' => 'portal', 'prefix' => 'portal',
'middleware' => 'portal', 'middleware' => 'portal',

View File

@ -2,12 +2,12 @@
namespace App\Exceptions; namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException; use Illuminate\Auth\AuthenticationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Debug\Exception\FatalThrowableError; use Symfony\Component\Debug\Exception\FatalThrowableError;
use Illuminate\Database\Eloquent\ModelNotFoundException; use Throwable;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
@ -35,10 +35,10 @@ class Handler extends ExceptionHandler
* *
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* *
* @param \Exception $exception * @param \Throwable $exception
* @return void * @return void
*/ */
public function report(Exception $exception) public function report(Throwable $exception)
{ {
parent::report($exception); parent::report($exception);
} }
@ -47,10 +47,10 @@ class Handler extends ExceptionHandler
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param \Exception $exception * @param \Throwable $exception
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function render($request, Exception $exception) public function render($request, Throwable $exception)
{ {
if (env('APP_DEBUG') === false) { if (env('APP_DEBUG') === false) {
return $this->handleExceptions($request, $exception); return $this->handleExceptions($request, $exception);

View File

@ -36,18 +36,18 @@ class Overrider
// Email // Email
$email_protocol = setting('email.protocol', 'mail'); $email_protocol = setting('email.protocol', 'mail');
config(['mail.driver' => $email_protocol]); config(['mail.default' => $email_protocol]);
config(['mail.from.name' => setting('company.name')]); config(['mail.from.name' => setting('company.name')]);
config(['mail.from.address' => setting('company.email')]); config(['mail.from.address' => setting('company.email')]);
if ($email_protocol == 'sendmail') { if ($email_protocol == 'sendmail') {
config(['mail.sendmail' => setting('email.sendmail_path')]); config(['mail.sendmail.path' => setting('email.sendmail_path')]);
} elseif ($email_protocol == 'smtp') { } elseif ($email_protocol == 'smtp') {
config(['mail.host' => setting('email.smtp_host')]); config(['mail.smtp.host' => setting('email.smtp_host')]);
config(['mail.port' => setting('email.smtp_port')]); config(['mail.smtp.port' => setting('email.smtp_port')]);
config(['mail.username' => setting('email.smtp_username')]); config(['mail.smtp.username' => setting('email.smtp_username')]);
config(['mail.password' => setting('email.smtp_password')]); config(['mail.smtp.password' => setting('email.smtp_password')]);
config(['mail.encryption' => setting('email.smtp_encryption')]); config(['mail.smtp.encryption' => setting('email.smtp_encryption')]);
} }
// Locale // Locale

View File

@ -12,7 +12,7 @@
"license": "GPL-3.0+", "license": "GPL-3.0+",
"type": "project", "type": "project",
"require": { "require": {
"php": "^7.2", "php": "^7.2.5",
"ext-bcmath": "*", "ext-bcmath": "*",
"akaunting/firewall": "1.2.*", "akaunting/firewall": "1.2.*",
"akaunting/language": "1.0.*", "akaunting/language": "1.0.*",
@ -28,15 +28,16 @@
"consoletvs/charts": "6.5.*", "consoletvs/charts": "6.5.*",
"dingo/api": "2.4.*", "dingo/api": "2.4.*",
"doctrine/dbal": "2.9.*", "doctrine/dbal": "2.9.*",
"fideloper/proxy": "4.2.*", "fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"genealabs/laravel-model-caching": "0.7.*", "genealabs/laravel-model-caching": "0.7.*",
"guzzlehttp/guzzle": "6.5.*", "guzzlehttp/guzzle": "^6.5",
"intervention/image": "2.5.*", "intervention/image": "2.5.*",
"jenssegers/date": "3.5.*", "jenssegers/date": "3.5.*",
"kyslik/column-sortable": "6.*", "kyslik/column-sortable": "6.*",
"laracasts/flash": "3.0.*", "laracasts/flash": "3.0.*",
"laravel/framework": "6.*", "laravel/framework": "^7.0",
"laravel/tinker": "2.0.*", "laravel/tinker": "^2.0",
"laravelcollective/html": "6.0.*", "laravelcollective/html": "6.0.*",
"lorisleiva/laravel-search-string": "0.1.*", "lorisleiva/laravel-search-string": "0.1.*",
"maatwebsite/excel": "3.1.*", "maatwebsite/excel": "3.1.*",
@ -50,11 +51,11 @@
}, },
"require-dev": { "require-dev": {
"beyondcode/laravel-dump-server": "^1.0", "beyondcode/laravel-dump-server": "^1.0",
"facade/ignition": "^1.4", "facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9", "fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.0", "mockery/mockery": "^1.3",
"nunomaduro/collision": "^3.0", "nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.0" "phpunit/phpunit": "^8.5"
}, },
"extra": { "extra": {
"laravel": { "laravel": {

View File

@ -212,6 +212,7 @@ return [
'File' => Illuminate\Support\Facades\File::class, 'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class, 'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class, 'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class, 'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class, 'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class, 'Mail' => Illuminate\Support\Facades\Mail::class,

View File

@ -97,7 +97,21 @@ return [
'provider' => 'users', 'provider' => 'users',
'table' => 'password_resets', 'table' => 'password_resets',
'expire' => 60, 'expire' => 60,
'throttle' => 60,
], ],
], ],,
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
]; ];

34
config/cors.php Normal file
View File

@ -0,0 +1,34 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
'paths' => ['api/*'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => false,
'max_age' => false,
'supports_credentials' => false,
];

View File

@ -138,16 +138,16 @@ return [
'url' => env('REDIS_URL'), 'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'), 'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null), 'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379), 'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', 0), 'database' => env('REDIS_DB', '0'),
], ],
'cache' => [ 'cache' => [
'url' => env('REDIS_URL'), 'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'), 'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null), 'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379), 'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', 1), 'database' => env('REDIS_CACHE_DB', '1'),
], ],
], ],

View File

@ -85,9 +85,24 @@ return [
'secret' => env('AWS_SECRET_ACCESS_KEY'), 'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'), 'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'), 'bucket' => env('AWS_BUCKET'),
'url' => app()->runningInConsole() ? '' : url('/'), 'url' => env('AWS_URL'),
], ],
],,
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
], ],
]; ];

View File

@ -96,6 +96,10 @@ return [
'handler' => NullHandler::class, 'handler' => NullHandler::class,
], ],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
], ],
]; ];

View File

@ -4,45 +4,67 @@ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Mail Driver | Default Mailer
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Laravel supports both SMTP and PHP's "mail" function as drivers for the | This option controls the default mailer that is used to send any email
| sending of e-mail. You may specify which one you're using throughout | messages sent by your application. Alternative mailers may be setup
| your application here. By default, Laravel is setup for SMTP mail. | and used as needed; however, this mailer will be used by default.
|
*/
'default' => env('MAIL_MAILER', 'smtp'),
/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
| |
| Supported: "smtp", "sendmail", "mailgun", "ses", | Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array" | "postmark", "log", "array", "mail"
|
*/
'driver' => env('MAIL_DRIVER', 'smtp'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
| |
*/ */
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'port' => env('MAIL_PORT', 587), 'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
],
'ses' => [
'transport' => 'ses',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
'mail' => [
'transport' => 'mail',
],
],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -60,47 +82,6 @@ return [
'name' => env('MAIL_FROM_NAME', 'Example'), 'name' => env('MAIL_FROM_NAME', 'Example'),
], ],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Markdown Mail Settings | Markdown Mail Settings
@ -120,17 +101,4 @@ return [
], ],
], ],
/*
|--------------------------------------------------------------------------
| Log Channel
|--------------------------------------------------------------------------
|
| If you are using the "log" driver, you may specify the logging channel
| if you prefer to keep mail messages separate from other log entries
| for simpler reading. Otherwise, the default channel will be used.
|
*/
'log_channel' => env('MAIL_LOG_CHANNEL'),
]; ];

View File

@ -163,7 +163,7 @@ return [
| |
*/ */
'secure' => env('SESSION_SECURE_COOKIE', false), 'secure' => env('SESSION_SECURE_COOKIE', null),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -187,10 +187,10 @@ return [
| take place, and can be used to mitigate CSRF attacks. By default, we | take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place. | do not enable this as other CSRF protection services are in place.
| |
| Supported: "lax", "strict" | Supported: "lax", "strict", "none"
| |
*/ */
'same_site' => null, 'same_site' => 'lax',
]; ];

View File

@ -33,4 +33,18 @@ return [
realpath(storage_path('framework/views')) realpath(storage_path('framework/views'))
), ),
/*
|--------------------------------------------------------------------------
| Blade View Modification Checking
|--------------------------------------------------------------------------
|
| On every request the framework will check to see if a view has expired
| to determine if it needs to be recompiled. If you are in production
| and precompiling views this feature may be disabled to save time.
|
*/
'expires' => env('VIEW_CHECK_EXPIRATION', true),
]; ];

View File

@ -22,7 +22,7 @@ class SampleData extends Seeder
{ {
Model::reguard(); Model::reguard();
config(['mail.driver' => 'log']); config(['mail.default' => 'log']);
$count = (int) $this->command->option('count'); $count = (int) $this->command->option('count');
$acc_count = ($count <= 10) ? $count : 10; $acc_count = ($count <= 10) ? $count : 10;

View File

@ -7,7 +7,7 @@
*/ */
// Define minimum supported PHP version // Define minimum supported PHP version
define('AKAUNTING_PHP', '7.2.0'); define('AKAUNTING_PHP', '7.2.5');
// Check PHP version // Check PHP version
if (version_compare(PHP_VERSION, AKAUNTING_PHP, '<')) { if (version_compare(PHP_VERSION, AKAUNTING_PHP, '<')) {

View File

@ -18,5 +18,6 @@ return [
'sent' => 'We have e-mailed your password reset link!', 'sent' => 'We have e-mailed your password reset link!',
'token' => 'This password reset token is invalid.', 'token' => 'This password reset token is invalid.',
'user' => "We can't find a user with that e-mail address.", 'user' => "We can't find a user with that e-mail address.",
'throttle' => 'Please wait before retrying.',
]; ];

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route;
/** /**
* 'admin' middleware applied to all routes * 'admin' middleware applied to all routes
* *

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route;
/** /**
* 'api' prefix applied to all routes * 'api' prefix applied to all routes
* *

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Broadcast;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Broadcast Channels | Broadcast Channels

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route;
/** /**
* 'common' middleware applied to all routes * 'common' middleware applied to all routes
* *

View File

@ -1,6 +1,7 @@
<?php <?php
use Illuminate\Foundation\Inspiring; use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route;
/** /**
* 'guest' middleware applied to all routes * 'guest' middleware applied to all routes
* *

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route;
/** /**
* 'install' middleware and prefix applied to all routes * 'install' middleware and prefix applied to all routes
* *

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route;
/** /**
* 'portal' middleware and prefix applied to all routes * 'portal' middleware and prefix applied to all routes
* *

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route;
/** /**
* 'signed' middleware and prefix applied to all routes * 'signed' middleware and prefix applied to all routes
* *

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route;
/** /**
* 'wizard' middleware and prefix applied to all routes * 'wizard' middleware and prefix applied to all routes
* *