mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 01:54:40 -04:00
Analytics
This commit is contained in:
parent
b8b3149582
commit
d4e2a0071a
49
app/DataMapper/Analytics/AccountCreated.php
Normal file
49
app/DataMapper/Analytics/AccountCreated.php
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\DataMapper\Analytics;
|
||||||
|
|
||||||
|
class AccountCreated
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The type of Sample.
|
||||||
|
*
|
||||||
|
* Monotonically incrementing counter
|
||||||
|
*
|
||||||
|
* - counter
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $type = 'counter';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the counter.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $name = 'account.created';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The datetime of the counter measurement.
|
||||||
|
*
|
||||||
|
* date("Y-m-d H:i:s")
|
||||||
|
*
|
||||||
|
* @var DateTime
|
||||||
|
*/
|
||||||
|
public $datetime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The increment amount... should always be
|
||||||
|
* set to 0.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $metric = 0;
|
||||||
|
}
|
49
app/DataMapper/Analytics/AccountDeleted.php
Normal file
49
app/DataMapper/Analytics/AccountDeleted.php
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\DataMapper\Analytics;
|
||||||
|
|
||||||
|
class AccountDeleted
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The type of Sample.
|
||||||
|
*
|
||||||
|
* Monotonically incrementing counter
|
||||||
|
*
|
||||||
|
* - counter
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $type = 'counter';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the counter.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $name = 'account.deleted';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The datetime of the counter measurement.
|
||||||
|
*
|
||||||
|
* date("Y-m-d H:i:s")
|
||||||
|
*
|
||||||
|
* @var DateTime
|
||||||
|
*/
|
||||||
|
public $datetime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The increment amount... should always be
|
||||||
|
* set to 0.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $metric = 0;
|
||||||
|
}
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\DataMapper\Analytics\AccountDeleted;
|
||||||
use App\DataMapper\CompanySettings;
|
use App\DataMapper\CompanySettings;
|
||||||
use App\DataMapper\DefaultSettings;
|
use App\DataMapper\DefaultSettings;
|
||||||
use App\Http\Requests\Company\CreateCompanyRequest;
|
use App\Http\Requests\Company\CreateCompanyRequest;
|
||||||
@ -40,6 +41,7 @@ use Illuminate\Foundation\Bus\DispatchesJobs;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Turbo124\Beacon\Facades\LightLogs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CompanyController.
|
* Class CompanyController.
|
||||||
@ -471,6 +473,11 @@ class CompanyController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$account->delete();
|
$account->delete();
|
||||||
|
|
||||||
|
LightLogs::create(new AccountDeleted())
|
||||||
|
->increment()
|
||||||
|
->batch();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$company_id = $company->id;
|
$company_id = $company->id;
|
||||||
$company->delete();
|
$company->delete();
|
||||||
|
@ -1,7 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
namespace App\Jobs\Account;
|
namespace App\Jobs\Account;
|
||||||
|
|
||||||
|
use App\DataMapper\Analytics\AccountCreated as AnalyticsAccountCreated;
|
||||||
use App\Events\Account\AccountCreated;
|
use App\Events\Account\AccountCreated;
|
||||||
use App\Jobs\Company\CreateCompany;
|
use App\Jobs\Company\CreateCompany;
|
||||||
use App\Jobs\Company\CreateCompanyPaymentTerms;
|
use App\Jobs\Company\CreateCompanyPaymentTerms;
|
||||||
@ -19,6 +29,7 @@ use Illuminate\Support\Facades\Log;
|
|||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Turbo124\Beacon\Facades\LightLogs;
|
||||||
|
|
||||||
class CreateAccount
|
class CreateAccount
|
||||||
{
|
{
|
||||||
@ -80,6 +91,10 @@ class CreateAccount
|
|||||||
|
|
||||||
$sp035a66->notification(new NewAccountCreated($spaa9f78, $sp035a66))->ninja();
|
$sp035a66->notification(new NewAccountCreated($spaa9f78, $sp035a66))->ninja();
|
||||||
|
|
||||||
|
LightLogs::create(new AnalyticsAccountCreated())
|
||||||
|
->increment()
|
||||||
|
->batch();
|
||||||
|
|
||||||
return $sp794f3f;
|
return $sp794f3f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,11 @@ if(!isset($design)) $design = 'light';
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
|
@if($settings)
|
||||||
--primary-color: {{ $settings->primary_color }};
|
--primary-color: {{ $settings->primary_color }};
|
||||||
|
@else
|
||||||
|
--primary-color: #4caf50;
|
||||||
|
@endif
|
||||||
}
|
}
|
||||||
|
|
||||||
.border-primary {
|
.border-primary {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user