Merge branch 'master' of github.com:akaunting/akaunting

This commit is contained in:
Cüneyt Şentürk
2023-03-29 10:00:16 +03:00
17 changed files with 305 additions and 195 deletions

View File

@ -1,10 +1,11 @@
name: Tests name: Tests
on: on:
push: push:
pull_request: pull_request:
schedule: schedule:
- cron: '0 0 * * *' - cron: '0 0 * * *'
workflow_dispatch:
jobs: jobs:
tests: tests:

View File

@ -0,0 +1,15 @@
<?php
namespace App\Events\Email;
use App\Abstracts\Event;
class TooManyEmailsSent extends Event
{
public $user_id;
public function __construct(int $user_id)
{
$this->user_id = $user_id;
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace App\Listeners\Email;
use App\Exceptions\Common\TooManyEmailsSent;
use App\Events\Email\TooManyEmailsSent as Event;
class ReportTooManyEmailsSent
{
public function handle(Event $event): void
{
report(new TooManyEmailsSent('Too many emails sent!'));
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace App\Listeners\Email;
use Akaunting\Firewall\Events\AttackDetected;
use Akaunting\Firewall\Traits\Helper;
use App\Events\Email\TooManyEmailsSent as Event;
use Illuminate\Support\Facades\Config;
class TellFirewallTooManyEmailsSent
{
use Helper;
public function handle(Event $event): void
{
$this->request = request();
$this->middleware = 'too_many_emails_sent';
$this->user_id = $event->user_id;
$this->loadConfig();
if ($this->skip($event)) {
return;
}
$log = $this->log();
event(new AttackDetected($log));
}
public function loadConfig(): void
{
$config = array_merge_recursive(
Config::get('firewall'),
[
'middleware' => [
$this->middleware => [
'enabled' => env('FIREWALL_MIDDLEWARE_' . strtoupper($this->middleware) . '_ENABLED', env('FIREWALL_ENABLED', true)),
'methods' => ['post'],
'routes' => [
'only' => [], // i.e. 'contact'
'except' => [], // i.e. 'admin/*'
],
'auto_block' => [
'attempts' => env('FIREWALL_MIDDLEWARE_' . strtoupper($this->middleware) . '_AUTO_BLOCK_ATTEMPTS', 20),
'frequency' => 1 * 60, // 1 minute
'period' => 30 * 60, // 30 minutes
],
],
],
]
);
Config::set('firewall', $config);
}
public function skip($event): bool
{
if ($this->isDisabled()) {
return true;
}
if ($this->isWhitelist()) {
return true;
}
return false;
}
}

View File

@ -104,6 +104,10 @@ class Event extends Provider
'App\Events\Setting\CategoryDeleted' => [ 'App\Events\Setting\CategoryDeleted' => [
'App\Listeners\Setting\DeleteCategoryDeletedSubCategories', 'App\Listeners\Setting\DeleteCategoryDeletedSubCategories',
], ],
'App\Events\Email\TooManyEmailsSent' => [
'App\Listeners\Email\ReportTooManyEmailsSent',
'App\Listeners\Email\TellFirewallTooManyEmailsSent',
],
]; ];
/** /**

View File

@ -3,7 +3,7 @@
namespace App\Traits; namespace App\Traits;
use App\Abstracts\Job; use App\Abstracts\Job;
use App\Exceptions\Common\TooManyEmailsSent; use App\Events\Email\TooManyEmailsSent;
use App\Traits\Jobs; use App\Traits\Jobs;
use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\Facades\RateLimiter;
@ -14,7 +14,7 @@ trait Emails
public function sendEmail(Job $job): array public function sendEmail(Job $job): array
{ {
// Check if the user has reached the limit of emails per month // Check if the user has reached the limit of emails per month
$key_per_month = 'email-month:' . user()->id; $key_per_month = 'email-month:' . user_id();
$limit_per_month = config('app.throttles.email.month'); $limit_per_month = config('app.throttles.email.month');
$decay_per_month = 60 * 60 * 24 * 30; $decay_per_month = 60 * 60 * 24 * 30;
@ -22,7 +22,7 @@ trait Emails
if ($can_send) { if ($can_send) {
// Check if the user has reached the limit of emails per minute // Check if the user has reached the limit of emails per minute
$key_per_minute = 'email-minute:' . user()->id; $key_per_minute = 'email-minute:' . user_id();
$limit_per_minute = config('app.throttles.email.minute'); $limit_per_minute = config('app.throttles.email.minute');
$can_send = RateLimiter::attempt($key_per_minute, $limit_per_minute, fn() => null); $can_send = RateLimiter::attempt($key_per_minute, $limit_per_minute, fn() => null);
@ -31,25 +31,21 @@ trait Emails
if ($can_send) { if ($can_send) {
$this->dispatch($job); $this->dispatch($job);
$response = [ return [
'success' => true, 'success' => true,
'error' => false, 'error' => false,
'data' => '', 'data' => '',
'message' => '', 'message' => '',
]; ];
return $response;
} }
$response = [ event(new TooManyEmailsSent(user_id()));
return [
'success' => false, 'success' => false,
'error' => true, 'error' => true,
'data' => null, 'data' => null,
'message' => 'Too many emails sent!', 'message' => 'Too many emails sent!',
]; ];
report(new TooManyEmailsSent('Too many emails sent!'));
return $response;
} }
} }

237
composer.lock generated
View File

@ -142,16 +142,16 @@
}, },
{ {
"name": "akaunting/laravel-firewall", "name": "akaunting/laravel-firewall",
"version": "2.1.0", "version": "2.1.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/akaunting/laravel-firewall.git", "url": "https://github.com/akaunting/laravel-firewall.git",
"reference": "6a44c0bf31530f3ae94fbee849395ee91c7ffb54" "reference": "ef48b2e63a7746e0513ce47d8e811ac58ad3bfc7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/akaunting/laravel-firewall/zipball/6a44c0bf31530f3ae94fbee849395ee91c7ffb54", "url": "https://api.github.com/repos/akaunting/laravel-firewall/zipball/ef48b2e63a7746e0513ce47d8e811ac58ad3bfc7",
"reference": "6a44c0bf31530f3ae94fbee849395ee91c7ffb54", "reference": "ef48b2e63a7746e0513ce47d8e811ac58ad3bfc7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -203,9 +203,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/akaunting/laravel-firewall/issues", "issues": "https://github.com/akaunting/laravel-firewall/issues",
"source": "https://github.com/akaunting/laravel-firewall/tree/2.1.0" "source": "https://github.com/akaunting/laravel-firewall/tree/2.1.3"
}, },
"time": "2023-03-07T12:53:34+00:00" "time": "2023-03-25T11:05:54+00:00"
}, },
{ {
"name": "akaunting/laravel-language", "name": "akaunting/laravel-language",
@ -798,23 +798,27 @@
}, },
{ {
"name": "aws/aws-crt-php", "name": "aws/aws-crt-php",
"version": "v1.0.4", "version": "v1.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/awslabs/aws-crt-php.git", "url": "https://github.com/awslabs/aws-crt-php.git",
"reference": "f5c64ee7c5fce196e2519b3d9b7138649efe032d" "reference": "1926277fc71d253dfa820271ac5987bdb193ccf5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/f5c64ee7c5fce196e2519b3d9b7138649efe032d", "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/1926277fc71d253dfa820271ac5987bdb193ccf5",
"reference": "f5c64ee7c5fce196e2519b3d9b7138649efe032d", "reference": "1926277fc71d253dfa820271ac5987bdb193ccf5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5" "php": ">=5.5"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.8.35|^5.6.3" "phpunit/phpunit": "^4.8.35||^5.6.3||^9.5",
"yoast/phpunit-polyfills": "^1.0"
},
"suggest": {
"ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality."
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -833,7 +837,7 @@
} }
], ],
"description": "AWS Common Runtime for PHP", "description": "AWS Common Runtime for PHP",
"homepage": "http://aws.amazon.com/sdkforphp", "homepage": "https://github.com/awslabs/aws-crt-php",
"keywords": [ "keywords": [
"amazon", "amazon",
"aws", "aws",
@ -842,22 +846,22 @@
], ],
"support": { "support": {
"issues": "https://github.com/awslabs/aws-crt-php/issues", "issues": "https://github.com/awslabs/aws-crt-php/issues",
"source": "https://github.com/awslabs/aws-crt-php/tree/v1.0.4" "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.1"
}, },
"time": "2023-01-31T23:08:25+00:00" "time": "2023-03-24T20:22:19+00:00"
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.261.14", "version": "3.262.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "121638bb7e62ee2f71838c52e79884f4301a9400" "reference": "42ca7ade60a775fc5eb103d4631df3d366b48a29"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/121638bb7e62ee2f71838c52e79884f4301a9400", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/42ca7ade60a775fc5eb103d4631df3d366b48a29",
"reference": "121638bb7e62ee2f71838c52e79884f4301a9400", "reference": "42ca7ade60a775fc5eb103d4631df3d366b48a29",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -936,9 +940,9 @@
"support": { "support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues", "issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.261.14" "source": "https://github.com/aws/aws-sdk-php/tree/3.262.1"
}, },
"time": "2023-03-17T18:21:00+00:00" "time": "2023-03-24T18:20:43+00:00"
}, },
{ {
"name": "balping/json-raw-encoder", "name": "balping/json-raw-encoder",
@ -2934,16 +2938,16 @@
}, },
{ {
"name": "genealabs/laravel-model-caching", "name": "genealabs/laravel-model-caching",
"version": "0.13.2", "version": "0.13.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/GeneaLabs/laravel-model-caching.git", "url": "https://github.com/GeneaLabs/laravel-model-caching.git",
"reference": "1fe37744efa9d5ed3d8c245c68271022b0e452ab" "reference": "631bb7f1d84c5863d82cff90e48152f65616597e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/GeneaLabs/laravel-model-caching/zipball/1fe37744efa9d5ed3d8c245c68271022b0e452ab", "url": "https://api.github.com/repos/GeneaLabs/laravel-model-caching/zipball/631bb7f1d84c5863d82cff90e48152f65616597e",
"reference": "1fe37744efa9d5ed3d8c245c68271022b0e452ab", "reference": "631bb7f1d84c5863d82cff90e48152f65616597e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2997,22 +3001,22 @@
"description": "Automatic caching for Eloquent models.", "description": "Automatic caching for Eloquent models.",
"support": { "support": {
"issues": "https://github.com/GeneaLabs/laravel-model-caching/issues", "issues": "https://github.com/GeneaLabs/laravel-model-caching/issues",
"source": "https://github.com/GeneaLabs/laravel-model-caching/tree/0.13.2" "source": "https://github.com/GeneaLabs/laravel-model-caching/tree/0.13.4"
}, },
"time": "2023-03-09T14:37:04+00:00" "time": "2023-03-27T13:53:10+00:00"
}, },
{ {
"name": "genealabs/laravel-pivot-events", "name": "genealabs/laravel-pivot-events",
"version": "10.0.0", "version": "10.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/GeneaLabs/laravel-pivot-events.git", "url": "https://github.com/GeneaLabs/laravel-pivot-events.git",
"reference": "48dc3cc7c26d6343741dd23f75763e79b7a2706b" "reference": "862371f6f89be296cc026c9cf5b372dca4d7958b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/GeneaLabs/laravel-pivot-events/zipball/48dc3cc7c26d6343741dd23f75763e79b7a2706b", "url": "https://api.github.com/repos/GeneaLabs/laravel-pivot-events/zipball/862371f6f89be296cc026c9cf5b372dca4d7958b",
"reference": "48dc3cc7c26d6343741dd23f75763e79b7a2706b", "reference": "862371f6f89be296cc026c9cf5b372dca4d7958b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3054,7 +3058,7 @@
"issues": "https://github.com/GeneaLabs/laravel-pivot/issues", "issues": "https://github.com/GeneaLabs/laravel-pivot/issues",
"source": "https://github.com/GeneaLabs/laravel-pivot" "source": "https://github.com/GeneaLabs/laravel-pivot"
}, },
"time": "2023-02-17T14:30:37+00:00" "time": "2023-03-22T14:46:23+00:00"
}, },
{ {
"name": "graham-campbell/markdown", "name": "graham-campbell/markdown",
@ -4655,16 +4659,16 @@
}, },
{ {
"name": "jaybizzle/crawler-detect", "name": "jaybizzle/crawler-detect",
"version": "v1.2.113", "version": "v1.2.114",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/JayBizzle/Crawler-Detect.git", "url": "https://github.com/JayBizzle/Crawler-Detect.git",
"reference": "6710b75871da2b718550c2bc33388315a3b20151" "reference": "62d0e6b38f6715c673e156ffb0fc894791de3452"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/6710b75871da2b718550c2bc33388315a3b20151", "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/62d0e6b38f6715c673e156ffb0fc894791de3452",
"reference": "6710b75871da2b718550c2bc33388315a3b20151", "reference": "62d0e6b38f6715c673e156ffb0fc894791de3452",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4701,9 +4705,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/JayBizzle/Crawler-Detect/issues", "issues": "https://github.com/JayBizzle/Crawler-Detect/issues",
"source": "https://github.com/JayBizzle/Crawler-Detect/tree/v1.2.113" "source": "https://github.com/JayBizzle/Crawler-Detect/tree/v1.2.114"
}, },
"time": "2023-02-02T21:01:40+00:00" "time": "2023-03-21T21:54:27+00:00"
}, },
{ {
"name": "jean85/pretty-package-versions", "name": "jean85/pretty-package-versions",
@ -5544,16 +5548,16 @@
}, },
{ {
"name": "league/commonmark", "name": "league/commonmark",
"version": "2.3.9", "version": "2.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/commonmark.git", "url": "https://github.com/thephpleague/commonmark.git",
"reference": "c1e114f74e518daca2729ea8c4bf1167038fa4b5" "reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/c1e114f74e518daca2729ea8c4bf1167038fa4b5", "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d44a24690f16b8c1808bf13b1bd54ae4c63ea048",
"reference": "c1e114f74e518daca2729ea8c4bf1167038fa4b5", "reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5589,7 +5593,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-main": "2.4-dev" "dev-main": "2.5-dev"
} }
}, },
"autoload": { "autoload": {
@ -5646,7 +5650,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-15T14:07:24+00:00" "time": "2023-03-24T15:16:10+00:00"
}, },
{ {
"name": "league/config", "name": "league/config",
@ -7883,38 +7887,44 @@
}, },
{ {
"name": "php-http/discovery", "name": "php-http/discovery",
"version": "1.14.3", "version": "1.15.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-http/discovery.git", "url": "https://github.com/php-http/discovery.git",
"reference": "31d8ee46d0215108df16a8527c7438e96a4d7735" "reference": "5cc428320191ac1d0b6520034c2dc0698628ced5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-http/discovery/zipball/31d8ee46d0215108df16a8527c7438e96a4d7735", "url": "https://api.github.com/repos/php-http/discovery/zipball/5cc428320191ac1d0b6520034c2dc0698628ced5",
"reference": "31d8ee46d0215108df16a8527c7438e96a4d7735", "reference": "5cc428320191ac1d0b6520034c2dc0698628ced5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer-plugin-api": "^1.0|^2.0",
"php": "^7.1 || ^8.0" "php": "^7.1 || ^8.0"
}, },
"conflict": { "conflict": {
"nyholm/psr7": "<1.0" "nyholm/psr7": "<1.0"
}, },
"provide": {
"php-http/async-client-implementation": "*",
"php-http/client-implementation": "*",
"psr/http-client-implementation": "*",
"psr/http-factory-implementation": "*",
"psr/http-message-implementation": "*"
},
"require-dev": { "require-dev": {
"composer/composer": "^1.0.2|^2.0",
"graham-campbell/phpspec-skip-example-extension": "^5.0", "graham-campbell/phpspec-skip-example-extension": "^5.0",
"php-http/httplug": "^1.0 || ^2.0", "php-http/httplug": "^1.0 || ^2.0",
"php-http/message-factory": "^1.0", "php-http/message-factory": "^1.0",
"phpspec/phpspec": "^5.1 || ^6.1" "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3",
"symfony/phpunit-bridge": "^6.2"
}, },
"suggest": { "type": "composer-plugin",
"php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories"
},
"type": "library",
"extra": { "extra": {
"branch-alias": { "class": "Http\\Discovery\\Composer\\Plugin",
"dev-master": "1.9-dev" "plugin-optional": true
}
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@ -7931,7 +7941,7 @@
"email": "mark.sagikazar@gmail.com" "email": "mark.sagikazar@gmail.com"
} }
], ],
"description": "Finds installed HTTPlug implementations and PSR-7 message factories", "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations",
"homepage": "http://php-http.org", "homepage": "http://php-http.org",
"keywords": [ "keywords": [
"adapter", "adapter",
@ -7940,13 +7950,14 @@
"factory", "factory",
"http", "http",
"message", "message",
"psr17",
"psr7" "psr7"
], ],
"support": { "support": {
"issues": "https://github.com/php-http/discovery/issues", "issues": "https://github.com/php-http/discovery/issues",
"source": "https://github.com/php-http/discovery/tree/1.14.3" "source": "https://github.com/php-http/discovery/tree/1.15.2"
}, },
"time": "2022-07-11T14:04:40+00:00" "time": "2023-02-11T08:28:41+00:00"
}, },
{ {
"name": "php-http/guzzle7-adapter", "name": "php-http/guzzle7-adapter",
@ -9087,16 +9098,16 @@
}, },
{ {
"name": "psy/psysh", "name": "psy/psysh",
"version": "v0.11.12", "version": "v0.11.13",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/bobthecow/psysh.git", "url": "https://github.com/bobthecow/psysh.git",
"reference": "52cb7c47d403c31c0adc9bf7710fc355f93c20f7" "reference": "722317c9f5627e588788e340f29b923e58f92f54"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/52cb7c47d403c31c0adc9bf7710fc355f93c20f7", "url": "https://api.github.com/repos/bobthecow/psysh/zipball/722317c9f5627e588788e340f29b923e58f92f54",
"reference": "52cb7c47d403c31c0adc9bf7710fc355f93c20f7", "reference": "722317c9f5627e588788e340f29b923e58f92f54",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -9157,9 +9168,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/bobthecow/psysh/issues", "issues": "https://github.com/bobthecow/psysh/issues",
"source": "https://github.com/bobthecow/psysh/tree/v0.11.12" "source": "https://github.com/bobthecow/psysh/tree/v0.11.13"
}, },
"time": "2023-01-29T21:24:40+00:00" "time": "2023-03-21T14:22:44+00:00"
}, },
{ {
"name": "ralouphie/getallheaders", "name": "ralouphie/getallheaders",
@ -9703,32 +9714,31 @@
}, },
{ {
"name": "sentry/sentry", "name": "sentry/sentry",
"version": "3.16.0", "version": "3.17.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/getsentry/sentry-php.git", "url": "https://github.com/getsentry/sentry-php.git",
"reference": "5326a8786b8c7c3a51ea0c6d06e6cb6a9dfa6779" "reference": "95d2e932383cf684f77acff0d2a5aef5ad2f1933"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/5326a8786b8c7c3a51ea0c6d06e6cb6a9dfa6779", "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/95d2e932383cf684f77acff0d2a5aef5ad2f1933",
"reference": "5326a8786b8c7c3a51ea0c6d06e6cb6a9dfa6779", "reference": "95d2e932383cf684f77acff0d2a5aef5ad2f1933",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"guzzlehttp/promises": "^1.4", "guzzlehttp/promises": "^1.4",
"guzzlehttp/psr7": "^1.8.4|^2.1.1",
"jean85/pretty-package-versions": "^1.5|^2.0.4", "jean85/pretty-package-versions": "^1.5|^2.0.4",
"php": "^7.2|^8.0", "php": "^7.2|^8.0",
"php-http/async-client-implementation": "^1.0", "php-http/async-client-implementation": "^1.0",
"php-http/client-common": "^1.5|^2.0", "php-http/client-common": "^1.5|^2.0",
"php-http/discovery": "^1.11, <1.15", "php-http/discovery": "^1.15",
"php-http/httplug": "^1.1|^2.0", "php-http/httplug": "^1.1|^2.0",
"php-http/message": "^1.5", "php-http/message": "^1.5",
"psr/http-factory": "^1.0", "psr/http-factory": "^1.0",
"psr/http-message-implementation": "^1.0", "psr/http-factory-implementation": "^1.0",
"psr/log": "^1.0|^2.0|^3.0", "psr/log": "^1.0|^2.0|^3.0",
"symfony/options-resolver": "^3.4.43|^4.4.30|^5.0.11|^6.0", "symfony/options-resolver": "^3.4.43|^4.4.30|^5.0.11|^6.0",
"symfony/polyfill-php80": "^1.17" "symfony/polyfill-php80": "^1.17"
@ -9739,6 +9749,7 @@
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^2.19|3.4.*", "friendsofphp/php-cs-fixer": "^2.19|3.4.*",
"guzzlehttp/psr7": "^1.8.4|^2.1.1",
"http-interop/http-factory-guzzle": "^1.0", "http-interop/http-factory-guzzle": "^1.0",
"monolog/monolog": "^1.6|^2.0|^3.0", "monolog/monolog": "^1.6|^2.0|^3.0",
"nikic/php-parser": "^4.10.3", "nikic/php-parser": "^4.10.3",
@ -9791,7 +9802,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/getsentry/sentry-php/issues", "issues": "https://github.com/getsentry/sentry-php/issues",
"source": "https://github.com/getsentry/sentry-php/tree/3.16.0" "source": "https://github.com/getsentry/sentry-php/tree/3.17.0"
}, },
"funding": [ "funding": [
{ {
@ -9803,20 +9814,20 @@
"type": "custom" "type": "custom"
} }
], ],
"time": "2023-03-16T10:37:16+00:00" "time": "2023-03-26T21:54:06+00:00"
}, },
{ {
"name": "sentry/sentry-laravel", "name": "sentry/sentry-laravel",
"version": "3.3.0", "version": "3.3.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/getsentry/sentry-laravel.git", "url": "https://github.com/getsentry/sentry-laravel.git",
"reference": "e9c87d6580fc56147f580e1d714d8eb4e06d2752" "reference": "c502e8b9005990d03f5ec5cc852e98a27c26056d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/e9c87d6580fc56147f580e1d714d8eb4e06d2752", "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/c502e8b9005990d03f5ec5cc852e98a27c26056d",
"reference": "e9c87d6580fc56147f580e1d714d8eb4e06d2752", "reference": "c502e8b9005990d03f5ec5cc852e98a27c26056d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -9884,7 +9895,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/getsentry/sentry-laravel/issues", "issues": "https://github.com/getsentry/sentry-laravel/issues",
"source": "https://github.com/getsentry/sentry-laravel/tree/3.3.0" "source": "https://github.com/getsentry/sentry-laravel/tree/3.3.2"
}, },
"funding": [ "funding": [
{ {
@ -9896,7 +9907,7 @@
"type": "custom" "type": "custom"
} }
], ],
"time": "2023-03-16T12:25:43+00:00" "time": "2023-03-22T10:51:03+00:00"
}, },
{ {
"name": "simple-icons/simple-icons", "name": "simple-icons/simple-icons",
@ -13198,16 +13209,16 @@
}, },
{ {
"name": "brianium/paratest", "name": "brianium/paratest",
"version": "v7.1.1", "version": "v7.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/paratestphp/paratest.git", "url": "https://github.com/paratestphp/paratest.git",
"reference": "abc123183e90f33ce1312b5bfaa49d80d8c646b2" "reference": "10e66ccdad397200f8129a034f0d3bf8cbe4c524"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/paratestphp/paratest/zipball/abc123183e90f33ce1312b5bfaa49d80d8c646b2", "url": "https://api.github.com/repos/paratestphp/paratest/zipball/10e66ccdad397200f8129a034f0d3bf8cbe4c524",
"reference": "abc123183e90f33ce1312b5bfaa49d80d8c646b2", "reference": "10e66ccdad397200f8129a034f0d3bf8cbe4c524",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -13221,7 +13232,7 @@
"phpunit/php-code-coverage": "^10.0.2", "phpunit/php-code-coverage": "^10.0.2",
"phpunit/php-file-iterator": "^4.0.1", "phpunit/php-file-iterator": "^4.0.1",
"phpunit/php-timer": "^6.0", "phpunit/php-timer": "^6.0",
"phpunit/phpunit": "^10.0.16", "phpunit/phpunit": "^10.0.17",
"sebastian/environment": "^6.0", "sebastian/environment": "^6.0",
"symfony/console": "^6.2.7", "symfony/console": "^6.2.7",
"symfony/process": "^6.2.7" "symfony/process": "^6.2.7"
@ -13231,8 +13242,8 @@
"ext-pcov": "*", "ext-pcov": "*",
"ext-posix": "*", "ext-posix": "*",
"infection/infection": "^0.26.19", "infection/infection": "^0.26.19",
"phpstan/phpstan": "^1.10.6", "phpstan/phpstan": "^1.10.7",
"phpstan/phpstan-deprecation-rules": "^1.1.2", "phpstan/phpstan-deprecation-rules": "^1.1.3",
"phpstan/phpstan-phpunit": "^1.3.10", "phpstan/phpstan-phpunit": "^1.3.10",
"phpstan/phpstan-strict-rules": "^1.5", "phpstan/phpstan-strict-rules": "^1.5",
"squizlabs/php_codesniffer": "^3.7.2", "squizlabs/php_codesniffer": "^3.7.2",
@ -13277,7 +13288,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/paratestphp/paratest/issues", "issues": "https://github.com/paratestphp/paratest/issues",
"source": "https://github.com/paratestphp/paratest/tree/v7.1.1" "source": "https://github.com/paratestphp/paratest/tree/v7.1.2"
}, },
"funding": [ "funding": [
{ {
@ -13289,7 +13300,7 @@
"type": "paypal" "type": "paypal"
} }
], ],
"time": "2023-03-13T10:11:07+00:00" "time": "2023-03-20T15:15:41+00:00"
}, },
{ {
"name": "fakerphp/faker", "name": "fakerphp/faker",
@ -13675,16 +13686,16 @@
}, },
{ {
"name": "nunomaduro/collision", "name": "nunomaduro/collision",
"version": "v7.1.2", "version": "v7.3.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nunomaduro/collision.git", "url": "https://github.com/nunomaduro/collision.git",
"reference": "f502ff3b2051124c89b4dd3a8a497ca65f3ce26c" "reference": "c680af93e414110b36056029f63120e6bc78f6e3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/f502ff3b2051124c89b4dd3a8a497ca65f3ce26c", "url": "https://api.github.com/repos/nunomaduro/collision/zipball/c680af93e414110b36056029f63120e6bc78f6e3",
"reference": "f502ff3b2051124c89b4dd3a8a497ca65f3ce26c", "reference": "c680af93e414110b36056029f63120e6bc78f6e3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -13694,19 +13705,19 @@
"symfony/console": "^6.2.7" "symfony/console": "^6.2.7"
}, },
"conflict": { "conflict": {
"phpunit/phpunit": "<10.0.16" "phpunit/phpunit": "<10.0.17"
}, },
"require-dev": { "require-dev": {
"brianium/paratest": "^7.1.1", "brianium/paratest": "^7.1.2",
"laravel/framework": "^10.3.3", "laravel/framework": "^10.4.1",
"laravel/pint": "^1.6.0", "laravel/pint": "^1.7.0",
"laravel/sail": "^1.21.2", "laravel/sail": "^1.21.2",
"laravel/sanctum": "^3.2.1", "laravel/sanctum": "^3.2.1",
"laravel/tinker": "^2.8.1", "laravel/tinker": "^2.8.1",
"nunomaduro/larastan": "^2.5.1", "nunomaduro/larastan": "^2.5.1",
"orchestra/testbench-core": "^8.0.5", "orchestra/testbench-core": "^8.1.1",
"pestphp/pest": "^2.0.0", "pestphp/pest": "^2.0.2",
"phpunit/phpunit": "^10.0.16", "phpunit/phpunit": "^10.0.17",
"sebastian/environment": "^6.0.0", "sebastian/environment": "^6.0.0",
"spatie/laravel-ignition": "^2.0.0" "spatie/laravel-ignition": "^2.0.0"
}, },
@ -13767,7 +13778,7 @@
"type": "patreon" "type": "patreon"
} }
], ],
"time": "2023-03-14T14:34:49+00:00" "time": "2023-03-23T21:41:35+00:00"
}, },
{ {
"name": "phar-io/manifest", "name": "phar-io/manifest",
@ -14200,16 +14211,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "10.0.16", "version": "10.0.19",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "07d386a11ac7094032900f07cada1c8975d16607" "reference": "20c23e85c86e5c06d63538ba464e8054f4744e62"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/07d386a11ac7094032900f07cada1c8975d16607", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/20c23e85c86e5c06d63538ba464e8054f4744e62",
"reference": "07d386a11ac7094032900f07cada1c8975d16607", "reference": "20c23e85c86e5c06d63538ba464e8054f4744e62",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -14280,7 +14291,8 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.16" "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.19"
}, },
"funding": [ "funding": [
{ {
@ -14296,7 +14308,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-03-13T09:02:40+00:00" "time": "2023-03-27T11:46:33+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
@ -14600,16 +14612,16 @@
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",
"version": "5.0.0", "version": "5.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/diff.git", "url": "https://github.com/sebastianbergmann/diff.git",
"reference": "70dd1b20bc198da394ad542e988381b44e64e39f" "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/70dd1b20bc198da394ad542e988381b44e64e39f", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02",
"reference": "70dd1b20bc198da394ad542e988381b44e64e39f", "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -14654,7 +14666,8 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/diff/issues", "issues": "https://github.com/sebastianbergmann/diff/issues",
"source": "https://github.com/sebastianbergmann/diff/tree/5.0.0" "security": "https://github.com/sebastianbergmann/diff/security/policy",
"source": "https://github.com/sebastianbergmann/diff/tree/5.0.1"
}, },
"funding": [ "funding": [
{ {
@ -14662,7 +14675,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-02-03T07:00:31+00:00" "time": "2023-03-23T05:12:41+00:00"
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",

Binary file not shown.

View File

@ -188,16 +188,6 @@ export default {
created: function() { created: function() {
this.form = new Form('form-create'); this.form = new Form('form-create');
// for override global currency variable..
this.currency = {
decimal: '.',
thousands: ',',
prefix: '$ ',
suffix: '',
precision: 2,
masked: false /* doesn't work with directive */
};
// Parent vue instance methods merge with child vue instance methods // Parent vue instance methods merge with child vue instance methods
if (this.$root.$options.methods) { if (this.$root.$options.methods) {
let parent_methods = this.$root.$options.methods; let parent_methods = this.$root.$options.methods;

View File

@ -42,7 +42,7 @@ return [
'send_invoice' => 'Send Invoice', 'send_invoice' => 'Send Invoice',
'get_paid' => 'Get Paid', 'get_paid' => 'Get Paid',
'accept_payments' => 'Accept Online Payments', 'accept_payments' => 'Accept Online Payments',
'payment_received' => 'Payment received', 'payments_received' => 'Payments received',
'form_description' => [ 'form_description' => [
'billing' => 'Billing details appear in your invoice. Invoice Date is used in the dashboard and reports. Select the date you expect to get paid as the Due Date.', 'billing' => 'Billing details appear in your invoice. Invoice Date is used in the dashboard and reports. Select the date you expect to get paid as the Due Date.',

View File

@ -11,62 +11,63 @@
<x-form.group.text name="name" label="{{ trans($textName) }}" form-group-class="{{ $classNameFromGroupClass }}" /> <x-form.group.text name="name" label="{{ trans($textName) }}" form-group-class="{{ $classNameFromGroupClass }}" />
@endif @endif
<div class="sm:col-span-3 grid gap-x-8 gap-y-6"> <div class="sm:col-span-3">
@if (! $hideEmail) <div class="relative sm:col-span-6 grid gap-x-8 gap-y-6">
<x-form.group.text name="email" label="{{ trans($textEmail) }}" not-required /> @if (! $hideEmail)
@endif <x-form.group.text name="email" label="{{ trans($textEmail) }}" form-group-class="sm:col-span-6" not-required />
@endif
@if (! $hidePhone) @if (! $hidePhone)
<x-form.group.text name="phone" label="{{ trans($textPhone) }}" not-required /> <x-form.group.text name="phone" label="{{ trans($textPhone) }}" form-group-class="sm:col-span-6" not-required />
@endif @endif
@if (! $hideWebsite) @if (! $hideWebsite)
<x-form.group.text name="website" label="{{ trans($textWebsite) }}" not-required /> <x-form.group.text name="website" label="{{ trans($textWebsite) }}" form-group-class="sm:col-span-6" not-required />
@endif @endif
@if (! $hideReference) @if (! $hideReference)
<x-form.group.text name="reference" label="{{ trans($textReference) }}" not-required /> <x-form.group.text name="reference" label="{{ trans($textReference) }}" form-group-class="sm:col-span-6" not-required />
@endif @endif
</div>
</div> </div>
<div class="sm:col-span-3"> <div class="sm:col-span-3">
@if (! $hideCanLogin) <div class="relative sm:col-span-6 grid gap-x-8 gap-y-6">
<div class="mt-9"> @if (! $hideCanLogin)
@if (empty($contact)) <div class="sm:col-span-6 mt-9 mb-2">
<x-tooltip id="tooltip-client_portal-text" placement="bottom" message="{{ trans('customers.can_login_description') }}"> @if (empty($contact))
<x-form.group.checkbox
name="create_user"
:options="['1' => trans('customers.can_login')]"
@input="onCanLogin($event)"
checkbox-class="sm:col-span-6"
/>
</x-tooltip>
@else
@if ($contact->user_id)
<x-form.group.checkbox
name="create_user"
:options="['1' => trans('customers.user_created')]"
checkbox-class="sm:col-span-6"
checked
disabled
/>
@else
<x-tooltip id="tooltip-client_portal-text" placement="bottom" message="{{ trans('customers.can_login_description') }}"> <x-tooltip id="tooltip-client_portal-text" placement="bottom" message="{{ trans('customers.can_login_description') }}">
<x-form.group.checkbox <x-form.group.checkbox
name="create_user" name="create_user"
:options="['1' => trans('customers.can_login')]" :options="['1' => trans('customers.can_login')]"
checkbox-class="sm:col-span-6"
@input="onCanLogin($event)" @input="onCanLogin($event)"
/> />
</x-tooltip> </x-tooltip>
@else
@if ($contact->user_id)
<x-form.group.checkbox
name="create_user"
:options="['1' => trans('customers.user_created')]"
checked
disabled
/>
@else
<x-tooltip id="tooltip-client_portal-text" placement="bottom" message="{{ trans('customers.can_login_description') }}">
<x-form.group.checkbox
name="create_user"
:options="['1' => trans('customers.can_login')]"
@input="onCanLogin($event)"
/>
</x-tooltip>
@endif
@endif @endif
@endif </div>
</div> @endif
@endif
@if (! $hideLogo) @if (! $hideLogo)
<x-form.group.file name="logo" label="{{ trans_choice('general.pictures', 1) }}" :value="! empty($contact) ? $contact->logo : false" not-required /> <x-form.group.file name="logo" label="{{ trans_choice('general.pictures', 1) }}" :value="! empty($contact) ? $contact->logo : false" form-group-class="sm:col-span-6" not-required />
@endif @endif
</div>
</div> </div>
</x-slot> </x-slot>
</x-form.section> </x-form.section>

View File

@ -7,22 +7,26 @@
</x-slot> </x-slot>
<x-slot name="body"> <x-slot name="body">
<div class="sm:col-span-2 grid gap-x-8 gap-y-6"> <div class="sm:col-span-2">
@if (! $hideDocumentTitle) <div class="relative sm:col-span-6 grid gap-x-8 gap-y-6">
<x-form.group.text name="title" label="{{ trans('settings.invoice.title') }}" value="{{ $titleSetting }}" not-required data-field="setting" /> @if (! $hideDocumentTitle)
@endif <x-form.group.text name="title" label="{{ trans('settings.invoice.title') }}" value="{{ $titleSetting }}" not-required data-field="setting" form-group-class="sm:col-span-6" />
@endif
@if (! $hideDocumentSubheading) @if (! $hideDocumentSubheading)
<x-form.group.text name="subheading" label="{{ trans('settings.invoice.subheading') }}" value="{{ $subheadingSetting }}" not-required data-field="setting" /> <x-form.group.text name="subheading" label="{{ trans('settings.invoice.subheading') }}" value="{{ $subheadingSetting }}" not-required data-field="setting" form-group-class="sm:col-span-6" />
@endif @endif
</div>
</div> </div>
<div class="sm:col-span-1"></div> <div class="sm:col-span-1"></div>
<div class="sm:col-span-2"> <div class="sm:col-span-2">
@if (! $hideLogo) <div class="relative sm:col-span-6 grid gap-x-8 gap-y-6">
<x-form.group.file name="company_logo" label="{{ trans('settings.company.logo') }}" :value="setting('company.logo')" not-required data-field="setting" /> @if (! $hideLogo)
@endif <x-form.group.file name="company_logo" label="{{ trans('settings.company.logo') }}" :value="setting('company.logo')" not-required data-field="setting" form-group-class="sm:col-span-6" />
@endif
</div>
</div> </div>
<div class="sm:col-span-2 relative"> <div class="sm:col-span-2 relative">

View File

@ -45,7 +45,7 @@
<div class="text-xs mt-6" style="margin-left: 0 !important;"> <div class="text-xs mt-6" style="margin-left: 0 !important;">
<span class="font-medium"> <span class="font-medium">
{{ trans('invoices.payment_received') }} : {{ trans('invoices.payments_received') }}:
</span> </span>
@if ($transactions->count()) @if ($transactions->count())

View File

@ -1,5 +1,5 @@
@props([ @props([
'metaTitle', 'title', 'metaTitle', 'title', 'currency'
]) ])
<head> <head>

View File

@ -100,7 +100,7 @@
<x-slot name="body" class="block" override="class"> <x-slot name="body" class="block" override="class">
<div class="text-xs mt-1" style="margin-left: 0 !important;"> <div class="text-xs mt-1" style="margin-left: 0 !important;">
<span class="font-medium"> <span class="font-medium">
{{ trans('invoices.payment_received') }} : {{ trans('invoices.payments_received') }}:
</span> </span>
@if ($invoice->transactions->count()) @if ($invoice->transactions->count())
@ -149,4 +149,4 @@
@endpush @endpush
<x-script folder="portal" file="apps" /> <x-script folder="portal" file="apps" />
</x-layouts.preview> </x-layouts.preview>

View File

@ -98,7 +98,7 @@
<x-slot name="body" class="block" override="class"> <x-slot name="body" class="block" override="class">
<div class="text-xs mt-1" style="margin-left: 0 !important;"> <div class="text-xs mt-1" style="margin-left: 0 !important;">
<span class="font-medium"> <span class="font-medium">
{{ trans('invoices.payment_received') }} : {{ trans('invoices.payments_received') }}:
</span> </span>
@if ($invoice->transactions->count()) @if ($invoice->transactions->count())

View File

@ -103,13 +103,13 @@
description="" description=""
/> />
</x-slot> </x-slot>
<x-slot name="body" class="block" override="class"> <x-slot name="body" class="block" override="class">
<div class="text-xs mt-1" style="margin-left: 0 !important;"> <div class="text-xs mt-1" style="margin-left: 0 !important;">
<span class="font-medium"> <span class="font-medium">
{{ trans('invoices.payment_received') }} : {{ trans('invoices.payments_received') }}:
</span> </span>
@if ($invoice->transactions->count()) @if ($invoice->transactions->count())
@foreach ($invoice->transactions as $transaction) @foreach ($invoice->transactions as $transaction)
<div class="my-2"> <div class="my-2">
@ -157,4 +157,4 @@
<x-script folder="portal" file="apps" /> <x-script folder="portal" file="apps" />
</x-layouts.signed> </x-layouts.signed>
</div> </div>