diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml
index d38b735e63ad..bb0c4f6f83b5 100644
--- a/.github/workflows/phpunit.yml
+++ b/.github/workflows/phpunit.yml
@@ -20,6 +20,8 @@ jobs:
CACHE_DRIVER: file
QUEUE_CONNECTION: sync
SESSION_DRIVER: file
+ NINJA_ENVIRONMENT: development
+ MULTI_DB_ENABLED: false
services:
mariadb:
@@ -69,7 +71,7 @@ jobs:
php artisan optimize
php artisan cache:clear
php artisan config:cache
-
+
- name: Create DB and schemas
run: |
mkdir -p database
@@ -85,7 +87,9 @@ jobs:
npm run production
- name: Run Testsuite
- run: vendor/bin/phpunit --testdox
+ run: |
+ cat .env
+ vendor/bin/phpunit --testdox
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 26d8d79d56db..00c38da9b33a 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -40,9 +40,6 @@ class Kernel extends ConsoleKernel
//$schedule->job(new RecurringInvoicesCron)->hourly();
$schedule->job(new VersionCheck)->daily();
- /* Build queue snapshots */
- $schedule->command('horizon:snapshot')->everyFiveMinutes();
-
/* Run queue's in shared hosting with this*/
if (Ninja::isSelfHost()) {
$schedule->command('queue:work')->everyMinute()->withoutOverlapping();
diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php
index 44069fcf8a5a..62a64ab447ee 100644
--- a/app/DataMapper/CompanySettings.php
+++ b/app/DataMapper/CompanySettings.php
@@ -144,7 +144,7 @@ class CompanySettings extends BaseSettings
public $pdf_email_attachment = false;
public $ubl_email_attachment = false;
- public $email_style = 'plain'; //plain, light, dark, custom
+ public $email_style = 'light'; //plain, light, dark, custom
public $email_style_custom = ''; //the template itself
public $email_subject_invoice = '';
public $email_subject_quote = '';
diff --git a/app/Designs/Designer.php b/app/Designs/Designer.php
index 355e47a4d541..4c5a3ab00d76 100644
--- a/app/Designs/Designer.php
+++ b/app/Designs/Designer.php
@@ -158,6 +158,10 @@ class Designer
//$this->exported_variables['$entity_labels'] = $this->processLabels($this->input_variables['quote_details'], $this->quoteDetails($company));
$this->exported_variables['$entity_details'] = $this->processVariables($this->input_variables['quote_details'], $this->quoteDetails($company));
}
+ else {
+ $this->exported_variables['$entity_details'] = $this->processVariables($this->input_variables['invoice_details'], $this->quoteDetails($company));
+ }
+
$this->exported_variables['$product_table_header']= $this->entity->buildTableHeader($this->input_variables['product_columns']);
$this->exported_variables['$product_table_body'] = $this->entity->buildTableBody($this->input_variables['product_columns'], $this->design->product, '$product');
@@ -265,22 +269,24 @@ class Designer
private function invoiceDetails(Company $company)
{
+
$data = [
- '$invoice.number' => '$invoice.number_label: $invoice.number',
- '$invoice.po_number' => '$invoice.po_number_label: $invoice.po_number',
- '$invoice.date' => '$invoice.date_label: $invoice.date',
- '$invoice.due_date' => '$invoice.due_date_label: $invoice.due_date',
- '$invoice.balance_due' => '$invoice.balance_due_label: $invoice.balance_due',
- '$invoice.total' => '$invoice.total_label: $invoice.total',
- '$invoice.partial_due' => '$invoice.partial_due_label: $invoice.partial_due',
- '$invoice.custom1' => '$invoice1_label: $invoice.custom1',
- '$invoice.custom2' => '$invoice2_label: $invoice.custom2',
- '$invoice.custom3' => '$invoice3_label: $invoice.custom3',
- '$invoice.custom4' => '$invoice4_label: $invoice.custom4',
- '$surcharge1' => '$surcharge1_label: $surcharge1',
- '$surcharge2' => '$surcharge2_label: $surcharge2',
- '$surcharge3' => '$surcharge3_label: $surcharge3',
- '$surcharge4' => '$surcharge4_label: $surcharge4',
+ '$invoice.number' => '$invoice.number_label: $invoice.number',
+ '$invoice.po_number' => '$invoice.po_number_label: $invoice.po_number',
+ '$invoice.date' => '$invoice.date_label: $invoice.date',
+ '$invoice.due_date' => '$invoice.due_date_label: $invoice.due_date',
+ '$invoice.balance_due' => '$invoice.balance_due_label: $invoice.balance_due',
+ '$invoice.total' => '$invoice.total_label: $invoice.total',
+ '$invoice.partial_due' => '$invoice.partial_due_label: $invoice.partial_due',
+ '$invoice.custom1' => '$invoice1_label: $invoice.custom1',
+ '$invoice.custom2' => '$invoice2_label: $invoice.custom2',
+ '$invoice.custom3' => '$invoice3_label: $invoice.custom3',
+ '$invoice.custom4' => '$invoice4_label: $invoice.custom4',
+ '$surcharge1' => '$surcharge1_label: $surcharge1',
+ '$surcharge2' => '$surcharge2_label: $surcharge2',
+ '$surcharge3' => '$surcharge3_label: $surcharge3',
+ '$surcharge4' => '$surcharge4_label: $surcharge4',
+
];
return $this->processCustomFields($company, $data);
@@ -289,21 +295,22 @@ class Designer
private function quoteDetails(Company $company)
{
$data = [
- '$quote.quote_number' => '$quote.number_label: $quote.number',
- '$quote.po_number' => '$quote.po_number_label: $quote.po_number',
- '$quote.quote_date' => '$quote.date_label: $quote.date',
- '$quote.valid_until' => '$quote.valid_until_label: $quote.valid_until',
- '$quote.balance_due' => '$quote.balance_due_label: $quote.balance_due',
- '$quote.quote_total' => '$quote.total_label: $quote.total',
- '$quote.partial_due' => '$quote.partial_due_label: $quote.partial_due',
- '$quote.custom1' => '$quote.custom1_label: $quote.custom1',
- '$quote.custom2' => '$quote.custom2_label: $quote.custom2',
- '$quote.custom3' => '$quote.custom3_label: $quote.custom3',
- '$quote.custom4' => '$quote.custom4_label: $quote.custom4',
- '$quote.surcharge1' => '$surcharge1_label: $surcharge1',
- '$quote.surcharge2' => '$surcharge2_label: $surcharge2',
- '$quote.surcharge3' => '$surcharge3_label: $surcharge3',
- '$quote.surcharge4' => '$surcharge4_label: $surcharge4',
+ '$quote.quote_number' => '$quote.number_label: $quote.number',
+ '$quote.po_number' => '$quote.po_number_label: $quote.po_number',
+ '$quote.quote_date' => '$quote.date_label: $quote.date',
+ '$quote.valid_until' => '$quote.valid_until_label: $quote.valid_until',
+ '$quote.balance_due' => '$quote.balance_due_label: $quote.balance_due',
+ '$quote.quote_total' => '$quote.total_label: $quote.total',
+ '$quote.partial_due' => '$quote.partial_due_label: $quote.partial_due',
+ '$quote.custom1' => '$quote.custom1_label: $quote.custom1',
+ '$quote.custom2' => '$quote.custom2_label: $quote.custom2',
+ '$quote.custom3' => '$quote.custom3_label: $quote.custom3',
+ '$quote.custom4' => '$quote.custom4_label: $quote.custom4',
+ '$quote.surcharge1' => '$surcharge1_label: $surcharge1',
+ '$quote.surcharge2' => '$surcharge2_label: $surcharge2',
+ '$quote.surcharge3' => '$surcharge3_label: $surcharge3',
+ '$quote.surcharge4' => '$surcharge4_label: $surcharge4',
+
];
return $this->processCustomFields($company, $data);
@@ -312,20 +319,21 @@ class Designer
private function creditDetails(Company $company)
{
$data = [
- '$credit.credit_number' => '$credit.number',
- '$credit.po_number' => '$credit.po_number',
- '$credit.credit_date' => '$credit.date',
- '$credit.credit_balance' => '$credit.balance',
- '$credit.credit_amount' => '$credit.amount',
- '$credit.partial_due' => '$credit.partial_due',
- '$credit.custom1' => '$credit.custom1',
- '$credit.custom2' => '$credit.custom2',
- '$credit.custom3' => '$credit.custom3',
- '$credit.custom4' => '$credit.custom4',
- '$credit.surcharge1' => '$surcharge1_label: $surcharge1',
- '$credit.surcharge2' => '$surcharge2_label: $surcharge2',
- '$credit.surcharge3' => '$surcharge3_label: $surcharge3',
- '$credit.surcharge4' => '$surcharge4_label: $surcharge4',
+ '$credit.credit_number' => '$credit.number_label$credit.number',
+ '$credit.po_number' => '$credit.po_number_label$credit.po_number',
+ '$credit.credit_date' => '$credit.date_label$credit.date',
+ '$credit.credit_balance' => '$credit.balance_label$credit.balance',
+ '$credit.credit_amount' => '$credit.amount_label$credit.amount',
+ '$credit.partial_due' => '$credit.partial_due_label$credit.partial_due',
+ '$credit.custom1' => '$credit.custom1_label$credit.custom1',
+ '$credit.custom2' => '$credit.custom2_label$credit.custom2',
+ '$credit.custom3' => '$credit.custom3_label$credit.custom3',
+ '$credit.custom4' => '$credit.custom4_label$credit.custom4',
+ '$credit.surcharge1' => '$surcharge1_label$surcharge1_label: $surcharge1',
+ '$credit.surcharge2' => '$surcharge2_label$surcharge2_label: $surcharge2',
+ '$credit.surcharge3' => '$surcharge3_label$surcharge3_label: $surcharge3',
+ '$credit.surcharge4' => '$surcharge4_label$surcharge4_label: $surcharge4',
+
];
return $this->processCustomFields($company, $data);
diff --git a/app/Http/Controllers/EmailController.php b/app/Http/Controllers/EmailController.php
new file mode 100644
index 000000000000..3832d25d71af
--- /dev/null
+++ b/app/Http/Controllers/EmailController.php
@@ -0,0 +1,101 @@
+json($data, 200);
+ }
+}
diff --git a/app/Http/Requests/Email/SendEmailRequest.php b/app/Http/Requests/Email/SendEmailRequest.php
new file mode 100644
index 000000000000..55ba254f2a59
--- /dev/null
+++ b/app/Http/Requests/Email/SendEmailRequest.php
@@ -0,0 +1,88 @@
+checkUserAbleToSend();
+ }
+
+ /**
+ * Get the validation rules that apply to the request.
+ *
+ * @return array
+ */
+ public function rules()
+ {
+ return [
+ "template" => "required",
+ "entity" => "required",
+ "entity_id" => "required",
+ "subject" => "required",
+ "body" => "required",
+ ];
+ }
+
+ protected function prepareForValidation()
+ {
+ $input = $this->all();
+
+ $settings = auth()->user()->company()->settings;
+
+ if(!property_exists($settings, $template))
+ unset($input['template']);
+
+ $this->replace($input);
+ }
+
+ public function message()
+ {
+ return [
+ 'template' => 'Invalid template.',
+ ];
+ }
+
+ private function checkUserAbleToSend()
+ {
+ $input = $this->all();
+
+ /*Make sure we have all the require ingredients to send a template*/
+ if(array_key_exists('entity', $input) && array_key_exists('entity_id', $input) && is_string($input['entity']) && is_string($input['entity_id'])) {
+
+ $company = auth()->user()->company();
+
+ $entity = ucfirst($input['entity']);
+
+ $class = "App\Models\\$entity";
+
+ /* Harvest the entity*/
+ $entity_obj = $class::whereId($this->decodePrimaryKey($input['entity_id']))->company()->first();
+
+ /* Check object, check user and company id is same as users, and check user can edit the object */
+ if($entity_obj && ($company->id == $entity_obj->company_id) && auth()->user()->can('edit', $entity_obj))
+ return true;
+
+ }
+
+ return false;
+ }
+}
diff --git a/app/Http/Requests/Quote/StoreQuoteRequest.php b/app/Http/Requests/Quote/StoreQuoteRequest.php
index d18b16155fc5..8386ed5ac12a 100644
--- a/app/Http/Requests/Quote/StoreQuoteRequest.php
+++ b/app/Http/Requests/Quote/StoreQuoteRequest.php
@@ -77,7 +77,7 @@ class StoreQuoteRequest extends Request
{
return [
'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx',
- 'client_id' => 'required|exists:clients,id',
+ 'client_id' => 'required|exists:clients,id,company_id,'.auth()->user()->company()->id,
];
}
}
diff --git a/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php b/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php
index c3f7903d173e..c0df8999e80f 100644
--- a/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php
+++ b/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php
@@ -36,7 +36,7 @@ class StoreRecurringInvoiceRequest extends Request
{
return [
'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx',
- 'client_id' => 'required|exists:clients,id',
+ 'client_id' => 'required|exists:clients,id,company_id,'.auth()->user()->company()->id,
];
}
diff --git a/app/Http/Requests/RecurringQuote/StoreRecurringQuoteRequest.php b/app/Http/Requests/RecurringQuote/StoreRecurringQuoteRequest.php
index d1713f4d9f37..0b7be6a989b0 100644
--- a/app/Http/Requests/RecurringQuote/StoreRecurringQuoteRequest.php
+++ b/app/Http/Requests/RecurringQuote/StoreRecurringQuoteRequest.php
@@ -36,8 +36,7 @@ class StoreRecurringQuoteRequest extends Request
{
return [
'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx',
- 'client_id' => 'required|exists:clients,id',
-
+ 'client_id' => 'required|exists:clients,id,company_id,'.auth()->user()->company()->id,
];
}
diff --git a/app/Jobs/Account/CreateAccount.php b/app/Jobs/Account/CreateAccount.php
index 3a022c17ed7f..1bdbeb0abac9 100644
--- a/app/Jobs/Account/CreateAccount.php
+++ b/app/Jobs/Account/CreateAccount.php
@@ -30,7 +30,7 @@ class CreateAccount
{
if (config('ninja.environment') == 'selfhost' && Account::all()->count() > 1) {
return response()->json(array('message' => Ninja::selfHostedMessage()), 400);
- } elseif (Ninja::boot()) {
+ } elseif (!Ninja::boot()) {
return response()->json(array('message' => Ninja::parse()), 401);
}
$sp794f3f = Account::create($this->request);
diff --git a/app/Listeners/SendVerificationNotification.php b/app/Listeners/SendVerificationNotification.php
index 9c4a7d831dbc..3b02a80c79f8 100644
--- a/app/Listeners/SendVerificationNotification.php
+++ b/app/Listeners/SendVerificationNotification.php
@@ -13,14 +13,14 @@ namespace App\Listeners;
use App\Libraries\MultiDB;
use App\Notifications\Ninja\VerifyUser;
-use App\Utils\Ninja;
-use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
-use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Mail;
+use App\Utils\Ninja;
+use Illuminate\Broadcasting\InteractsWithSockets;
+use Illuminate\Foundation\Events\Dispatchable;
+use Illuminate\Queue\SerializesModels;
class SendVerificationNotification implements ShouldQueue
{
diff --git a/app/Listeners/User/ArchivedUserActivity.php b/app/Listeners/User/ArchivedUserActivity.php
index 5ee2f3d70f00..887454229fc4 100644
--- a/app/Listeners/User/ArchivedUserActivity.php
+++ b/app/Listeners/User/ArchivedUserActivity.php
@@ -16,7 +16,7 @@ use App\Repositories\ActivityRepository;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
-class ArchivedUserActivity
+class ArchivedUserActivity implements ShouldQueue
{
protected $activityRepo;
/**
diff --git a/app/Listeners/User/CreatedUserActivity.php b/app/Listeners/User/CreatedUserActivity.php
index cb21c23c31a8..ada9fb56d672 100644
--- a/app/Listeners/User/CreatedUserActivity.php
+++ b/app/Listeners/User/CreatedUserActivity.php
@@ -16,7 +16,7 @@ use App\Repositories\ActivityRepository;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
-class CreatedUserActivity
+class CreatedUserActivity implements ShouldQueue
{
protected $activityRepo;
/**
diff --git a/app/Listeners/User/RestoredUserActivity.php b/app/Listeners/User/RestoredUserActivity.php
index a147be9c893b..d3e035af63df 100644
--- a/app/Listeners/User/RestoredUserActivity.php
+++ b/app/Listeners/User/RestoredUserActivity.php
@@ -16,7 +16,7 @@ use App\Repositories\ActivityRepository;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
-class RestoredUserActivity
+class RestoredUserActivity implements ShouldQueue
{
protected $activityRepo;
/**
diff --git a/app/Listeners/User/UpdateUserLastLogin.php b/app/Listeners/User/UpdateUserLastLogin.php
index f63b567e17b9..89b96c7b2504 100644
--- a/app/Listeners/User/UpdateUserLastLogin.php
+++ b/app/Listeners/User/UpdateUserLastLogin.php
@@ -15,9 +15,14 @@ use App\Models\Activity;
use App\Repositories\ActivityRepository;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Broadcasting\InteractsWithSockets;
+use Illuminate\Foundation\Events\Dispatchable;
+use Illuminate\Queue\SerializesModels;
-class UpdateUserLastLogin
+class UpdateUserLastLogin implements ShouldQueue
{
+ use Dispatchable, InteractsWithSockets, SerializesModels;
+
/**
* Create the event listener.
*
@@ -34,7 +39,7 @@ class UpdateUserLastLogin
* @return void
*/
public function handle($event)
- {
+ { //\Log::error("listener firing");
$user = $event->user;
$user->last_login = now();
diff --git a/app/Listeners/User/UpdatedUserActivity.php b/app/Listeners/User/UpdatedUserActivity.php
index a126e62e4697..1d9f656f213c 100644
--- a/app/Listeners/User/UpdatedUserActivity.php
+++ b/app/Listeners/User/UpdatedUserActivity.php
@@ -16,7 +16,7 @@ use App\Repositories\ActivityRepository;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
-class UpdatedUserActivity
+class UpdatedUserActivity implements ShouldQueue
{
protected $activityRepo;
/**
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 2b07d408b0b6..e3a0e83660da 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -39,6 +39,10 @@ use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
+use Illuminate\Support\Facades\Queue;
+use Illuminate\Queue\Events\JobFailed;
+use Illuminate\Queue\Events\JobProcessing;
+
class AppServiceProvider extends ServiceProvider
{
@@ -72,6 +76,20 @@ class AppServiceProvider extends ServiceProvider
Proposal::observe(ProposalObserver::class);
Quote::observe(QuoteObserver::class);
Task::observe(TaskObserver::class);
+
+
+ // Queue::before(function (JobProcessing $event) {
+ // \Log::info('Event Job '.$event->connectionName);
+ // \Log::info('Event Job '.$event->job);
+ // \Log::info('Event Job '.$event->job->payload());
+ // });
+ // //! Update Posted AT
+ // Queue::after(function (JobProcessed $event) {
+ // \Log::info('Event Job '.$event->connectionName);
+ // \Log::info('Event Job '.$event->job);
+ // \Log::info('Event Job '.$event->job->payload());
+ // });
+
}
/**
@@ -82,6 +100,8 @@ class AppServiceProvider extends ServiceProvider
public function register()
{
$this->loadHelpers();
+
+
}
protected function loadHelpers()
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index 62cc51c40cd2..a1a1f90964f0 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -160,8 +160,19 @@ class EventServiceProvider extends ServiceProvider
*
* @return void
*/
+ // public function boot()
+ // {
+ // parent::boot();
+ // }
+
public function boot()
- {
- parent::boot();
- }
+ {
+ parent::boot();
+ //$events->subscribe('*');
+ // \Event::listen('event.*', function ($eventName, array $data) {
+ // \Log::error("Event Service Provider");
+ // });
+
+
+ }
}
diff --git a/app/Providers/MultiDBProvider.php b/app/Providers/MultiDBProvider.php
index c5e594634cde..07a14e8da642 100644
--- a/app/Providers/MultiDBProvider.php
+++ b/app/Providers/MultiDBProvider.php
@@ -32,20 +32,27 @@ class MultiDBProvider extends ServiceProvider
*/
public function register()
{
- if ($this->app->runningInConsole()) {
- return;
- }
-
$this->app['events']->listen(
\Illuminate\Queue\Events\JobProcessing::class,
function ($event) {
+
if (isset($event->job->payload()['db'])) {
- \Log::error("Provider Setting DB = ".$event->job->payload()['db']);
+
+ //\Log::error("Provider Setting DB = ".$event->job->payload()['db']);
+ //\Log::error('Event Job '.$event->connectionName);
+// \Log::error(print_r($event->job,1));
+ //\Log::error(print_r($event->job->payload(),1));
MultiDB::setDb($event->job->payload()['db']);
}
}
);
+
+
+ if ($this->app->runningInConsole()) {
+ return;
+ }
+
}
}
diff --git a/app/Utils/Ninja.php b/app/Utils/Ninja.php
index 5f2f35704fef..70800c7fed41 100644
--- a/app/Utils/Ninja.php
+++ b/app/Utils/Ninja.php
@@ -39,7 +39,7 @@ class Ninja
public static function isNinjaDev()
{
- return config('ninja.app_env') == 'development';
+ return config('ninja.environment') == 'development';
}
public static function getDebugInfo()
@@ -69,9 +69,9 @@ class Ninja
$data = json_decode($data);
if ($data && property_exists($data, 'message') && $data->message == sha1(config('ninja.license'))) {
- return false;
- } else {
return true;
+ } else {
+ return false;
}
}
diff --git a/app/Utils/TemplateEngine.php b/app/Utils/TemplateEngine.php
index 0f516bcff1d2..c9e06a1cba9d 100644
--- a/app/Utils/TemplateEngine.php
+++ b/app/Utils/TemplateEngine.php
@@ -156,14 +156,20 @@ class TemplateEngine
$data['footer'] = '';
if ($email_style == 'custom') {
+
$wrapper = $this->settings_entity->getSetting('email_style_custom');
- $wrapper = $this->renderView($wrapper, $data);
+
+ /*If no custom design exists, send back a blank!*/
+ if(strlen($wrapper) > 1)
+ $wrapper = $this->renderView($wrapper, $data);
+ else
+ $wrapper = '';
+
} else {
$wrapper = $this->getTemplate();
$wrapper = view($this->getTemplatePath($email_style), $data)->render();
}
-
$data = [
'subject' => $this->subject,
'body' => $this->body,
diff --git a/composer.json b/composer.json
index 34a7902a8250..0762d59264ad 100644
--- a/composer.json
+++ b/composer.json
@@ -32,7 +32,6 @@
"intervention/image": "^2.4",
"laracasts/presenter": "^0.2.1",
"laravel/framework": "^6",
- "laravel/horizon": "3.7.2",
"laravel/slack-notification-channel": "^2.0",
"laravel/socialite": "^4.0",
"laravel/tinker": "^1.0",
diff --git a/config/app.php b/config/app.php
index c7ea0bfd335a..4f6e07a20427 100644
--- a/config/app.php
+++ b/config/app.php
@@ -176,7 +176,6 @@ return [
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
- App\Providers\HorizonServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\ComposerServiceProvider::class,
Codedge\Updater\UpdaterServiceProvider::class,
diff --git a/config/horizon.php b/config/horizon.php
deleted file mode 100644
index a7655ac18007..000000000000
--- a/config/horizon.php
+++ /dev/null
@@ -1,168 +0,0 @@
- null,
-
- /*
- |--------------------------------------------------------------------------
- | Horizon Path
- |--------------------------------------------------------------------------
- |
- | This is the URI path where Horizon will be accessible from. Feel free
- | to change this path to anything you like. Note that the URI will not
- | affect the paths of its internal API that aren't exposed to users.
- |
- */
-
- 'path' => 'horizon',
-
- /*
- |--------------------------------------------------------------------------
- | Horizon Redis Connection
- |--------------------------------------------------------------------------
- |
- | This is the name of the Redis connection where Horizon will store the
- | meta information required for it to function. It includes the list
- | of supervisors, failed jobs, job metrics, and other information.
- |
- */
-
- 'use' => 'default',
-
- /*
- |--------------------------------------------------------------------------
- | Horizon Redis Prefix
- |--------------------------------------------------------------------------
- |
- | This prefix will be used when storing all Horizon data in Redis. You
- | may modify the prefix when you are running multiple installations
- | of Horizon on the same server so that they don't have problems.
- |
- */
-
- 'prefix' => env('HORIZON_PREFIX', 'horizon:'),
-
- /*
- |--------------------------------------------------------------------------
- | Horizon Route Middleware
- |--------------------------------------------------------------------------
- |
- | These middleware will get attached onto each Horizon route, giving you
- | the chance to add your own middleware to this list or change any of
- | the existing middleware. Or, you can simply stick with this list.
- |
- */
-
- 'middleware' => ['web'],
-
- /*
- |--------------------------------------------------------------------------
- | Queue Wait Time Thresholds
- |--------------------------------------------------------------------------
- |
- | This option allows you to configure when the LongWaitDetected event
- | will be fired. Every connection / queue combination may have its
- | own, unique threshold (in seconds) before this event is fired.
- |
- */
-
- 'waits' => [
- 'redis:default' => 60,
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Job Trimming Times
- |--------------------------------------------------------------------------
- |
- | Here you can configure for how long (in minutes) you desire Horizon to
- | persist the recent and failed jobs. Typically, recent jobs are kept
- | for one hour while all failed jobs are stored for an entire week.
- |
- */
-
- 'trim' => [
- 'recent' => 60,
- 'completed' => 60,
- 'recent_failed' => 10080,
- 'failed' => 10080,
- 'monitored' => 10080,
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Fast Termination
- |--------------------------------------------------------------------------
- |
- | When this option is enabled, Horizon's "terminate" command will not
- | wait on all of the workers to terminate unless the --wait option
- | is provided. Fast termination can shorten deployment delay by
- | allowing a new instance of Horizon to start while the last
- | instance will continue to terminate each of its workers.
- |
- */
-
- 'fast_termination' => false,
-
- /*
- |--------------------------------------------------------------------------
- | Memory Limit (MB)
- |--------------------------------------------------------------------------
- |
- | This value describes the maximum amount of memory the Horizon worker
- | may consume before it is terminated and restarted. You should set
- | this value according to the resources available to your server.
- |
- */
-
- 'memory_limit' => 512,
-
- /*
- |--------------------------------------------------------------------------
- | Queue Worker Configuration
- |--------------------------------------------------------------------------
- |
- | Here you may define the queue worker settings used by your application
- | in all environments. These supervisors and settings handle all your
- | queued jobs and will be provisioned by Horizon during deployment.
- |
- */
-
- 'environments' => [
- 'production' => [
- 'supervisor-1' => [
- 'connection' => 'redis',
- 'queue' => ['default'],
- 'balance' => 'simple',
- 'processes' => 2,
- 'memory'=> 512,
- 'timeout'=> 360,
- 'tries' => 3,
- ],
- ],
-
- 'local' => [
- 'supervisor-1' => [
- 'connection' => 'redis',
- 'queue' => ['default'],
- 'balance' => 'simple',
- 'processes' => 3,
- 'memory'=> 512,
- 'timeout'=> 360,
- 'tries' => 3,
- ],
- ],
- ],
-];
diff --git a/routes/api.php b/routes/api.php
index 33fec9fd7dc1..dfd888a87c6a 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -121,6 +121,8 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::post('claim_license', 'LicenseController@index')->name('license.index');
+ Route::post('emails', 'EmailController@send')->name('email.send');
+
/*
Route::resource('tasks', 'TaskController'); // name = (tasks. index / create / show / update / destroy / edit