1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Laravel 6 support

This commit is contained in:
Joshua Dwire 2021-09-25 20:13:01 -04:00
parent 63b331dcc8
commit 40c30cce2f
83 changed files with 4487 additions and 2529 deletions

View File

@ -7,8 +7,7 @@ use Illuminate\Auth\AuthenticationException;
use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Foundation\Validation\ValidationException; use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Http\Exception\HttpResponseException;
use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Response;
use Illuminate\Session\TokenMismatchException; use Illuminate\Session\TokenMismatchException;
use Redirect; use Redirect;
@ -30,7 +29,6 @@ class Handler extends ExceptionHandler
protected $dontReport = [ protected $dontReport = [
TokenMismatchException::class, TokenMismatchException::class,
ModelNotFoundException::class, ModelNotFoundException::class,
ValidationException::class,
\Illuminate\Validation\ValidationException::class, \Illuminate\Validation\ValidationException::class,
//AuthorizationException::class, //AuthorizationException::class,
//HttpException::class, //HttpException::class,

View File

@ -35,7 +35,6 @@ use Auth;
use Cache; use Cache;
use File; use File;
use Image; use Image;
use Input;
use Redirect; use Redirect;
use Request; use Request;
use Response; use Response;
@ -109,7 +108,7 @@ class AccountController extends BaseController
{ {
$user = false; $user = false;
$account = false; $account = false;
$guestKey = Input::get('guest_key'); // local storage key to login until registered $guestKey = \Request::input('guest_key'); // local storage key to login until registered
if (Auth::check()) { if (Auth::check()) {
return Redirect::to('invoices/create'); return Redirect::to('invoices/create');
@ -141,13 +140,13 @@ class AccountController extends BaseController
Session::flash('warning', $message); Session::flash('warning', $message);
} }
if ($redirectTo = Input::get('redirect_to')) { if ($redirectTo = \Request::input('redirect_to')) {
$redirectTo = SITE_URL . '/' . ltrim($redirectTo, '/'); $redirectTo = SITE_URL . '/' . ltrim($redirectTo, '/');
} else { } else {
$redirectTo = Input::get('sign_up') ? 'dashboard' : 'invoices/create'; $redirectTo = \Request::input('sign_up') ? 'dashboard' : 'invoices/create';
} }
return Redirect::to($redirectTo)->with('sign_up', Input::get('sign_up')); return Redirect::to($redirectTo)->with('sign_up', \Request::input('sign_up'));
} }
/** /**
@ -159,9 +158,9 @@ class AccountController extends BaseController
$account = $user->account; $account = $user->account;
$company = $account->company; $company = $account->company;
$plan = Input::get('plan'); $plan = \Request::input('plan');
$term = Input::get('plan_term'); $term = \Request::input('plan_term');
$numUsers = Input::get('num_users'); $numUsers = \Request::input('num_users');
if ($plan != PLAN_ENTERPRISE) { if ($plan != PLAN_ENTERPRISE) {
$numUsers = 1; $numUsers = 1;
@ -764,11 +763,11 @@ class AccountController extends BaseController
{ {
$user = Auth::user(); $user = Auth::user();
$account = $user->account; $account = $user->account;
$modules = Input::get('modules'); $modules = \Request::input('modules');
if (Utils::isSelfHost()) { if (Utils::isSelfHost()) {
// get all custom modules, including disabled // get all custom modules, including disabled
$custom_modules = collect(Input::get('custom_modules'))->each(function ($item, $key) { $custom_modules = collect(\Request::input('custom_modules'))->each(function ($item, $key) {
$module = Module::find($item); $module = Module::find($item);
if ($module && $module->disabled()) { if ($module && $module->disabled()) {
$module->enable(); $module->enable();
@ -782,10 +781,10 @@ class AccountController extends BaseController
}); });
} }
$user->force_pdfjs = Input::get('force_pdfjs') ? true : false; $user->force_pdfjs = \Request::input('force_pdfjs') ? true : false;
$user->save(); $user->save();
$account->live_preview = Input::get('live_preview') ? true : false; $account->live_preview = \Request::input('live_preview') ? true : false;
// Automatically disable live preview when using a large font // Automatically disable live preview when using a large font
$fonts = Cache::get('fonts')->filter(function ($font) use ($account) { $fonts = Cache::get('fonts')->filter(function ($font) use ($account) {
@ -813,7 +812,7 @@ class AccountController extends BaseController
*/ */
private function saveCustomizeDesign() private function saveCustomizeDesign()
{ {
$designId = intval(Input::get('design_id')) ?: CUSTOM_DESIGN1; $designId = intval(\Request::input('design_id')) ?: CUSTOM_DESIGN1;
$field = 'custom_design' . ($designId - 10); $field = 'custom_design' . ($designId - 10);
if (Auth::user()->account->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN)) { if (Auth::user()->account->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN)) {
@ -821,7 +820,7 @@ class AccountController extends BaseController
if (! $account->custom_design1) { if (! $account->custom_design1) {
$account->invoice_design_id = CUSTOM_DESIGN1; $account->invoice_design_id = CUSTOM_DESIGN1;
} }
$account->$field = Input::get('custom_design'); $account->$field = \Request::input('custom_design');
$account->save(); $account->save();
Session::flash('message', trans('texts.updated_settings')); Session::flash('message', trans('texts.updated_settings'));
@ -897,28 +896,28 @@ class AccountController extends BaseController
foreach (AccountEmailSettings::$templates as $type) { foreach (AccountEmailSettings::$templates as $type) {
$subjectField = "email_subject_{$type}"; $subjectField = "email_subject_{$type}";
$subject = Input::get($subjectField, $account->getEmailSubject($type)); $subject = \Request::input($subjectField, $account->getEmailSubject($type));
$account->account_email_settings->$subjectField = ($subject == $account->getDefaultEmailSubject($type) ? null : $subject); $account->account_email_settings->$subjectField = ($subject == $account->getDefaultEmailSubject($type) ? null : $subject);
$bodyField = "email_template_{$type}"; $bodyField = "email_template_{$type}";
$body = Input::get($bodyField, $account->getEmailTemplate($type)); $body = \Request::input($bodyField, $account->getEmailTemplate($type));
$account->account_email_settings->$bodyField = ($body == $account->getDefaultEmailTemplate($type) ? null : $body); $account->account_email_settings->$bodyField = ($body == $account->getDefaultEmailTemplate($type) ? null : $body);
} }
foreach ([TEMPLATE_REMINDER1, TEMPLATE_REMINDER2, TEMPLATE_REMINDER3] as $type) { foreach ([TEMPLATE_REMINDER1, TEMPLATE_REMINDER2, TEMPLATE_REMINDER3] as $type) {
$enableField = "enable_{$type}"; $enableField = "enable_{$type}";
$account->$enableField = Input::get($enableField) ? true : false; $account->$enableField = \Request::input($enableField) ? true : false;
$account->{"num_days_{$type}"} = Input::get("num_days_{$type}"); $account->{"num_days_{$type}"} = \Request::input("num_days_{$type}");
$account->{"field_{$type}"} = Input::get("field_{$type}"); $account->{"field_{$type}"} = \Request::input("field_{$type}");
$account->{"direction_{$type}"} = Input::get("field_{$type}") == REMINDER_FIELD_INVOICE_DATE ? REMINDER_DIRECTION_AFTER : Input::get("direction_{$type}"); $account->{"direction_{$type}"} = \Request::input("field_{$type}") == REMINDER_FIELD_INVOICE_DATE ? REMINDER_DIRECTION_AFTER : \Request::input("direction_{$type}");
$number = preg_replace('/[^0-9]/', '', $type); $number = preg_replace('/[^0-9]/', '', $type);
$account->account_email_settings->{"late_fee{$number}_amount"} = Input::get("late_fee{$number}_amount"); $account->account_email_settings->{"late_fee{$number}_amount"} = \Request::input("late_fee{$number}_amount");
$account->account_email_settings->{"late_fee{$number}_percent"} = Input::get("late_fee{$number}_percent"); $account->account_email_settings->{"late_fee{$number}_percent"} = \Request::input("late_fee{$number}_percent");
} }
$account->enable_reminder4 = Input::get('enable_reminder4') ? true : false; $account->enable_reminder4 = \Request::input('enable_reminder4') ? true : false;
$account->account_email_settings->frequency_id_reminder4 = Input::get('frequency_id_reminder4'); $account->account_email_settings->frequency_id_reminder4 = \Request::input('frequency_id_reminder4');
$account->save(); $account->save();
$account->account_email_settings->save(); $account->account_email_settings->save();
@ -935,7 +934,7 @@ class AccountController extends BaseController
private function saveTaxRates() private function saveTaxRates()
{ {
$account = Auth::user()->account; $account = Auth::user()->account;
$account->fill(Input::all()); $account->fill(Request::all());
$account->save(); $account->save();
Session::flash('message', trans('texts.updated_settings')); Session::flash('message', trans('texts.updated_settings'));
@ -950,10 +949,10 @@ class AccountController extends BaseController
{ {
$account = Auth::user()->account; $account = Auth::user()->account;
$account->show_product_notes = Input::get('show_product_notes') ? true : false; $account->show_product_notes = \Request::input('show_product_notes') ? true : false;
$account->fill_products = Input::get('fill_products') ? true : false; $account->fill_products = \Request::input('fill_products') ? true : false;
$account->update_products = Input::get('update_products') ? true : false; $account->update_products = \Request::input('update_products') ? true : false;
$account->convert_products = Input::get('convert_products') ? true : false; $account->convert_products = \Request::input('convert_products') ? true : false;
$account->save(); $account->save();
Session::flash('message', trans('texts.updated_settings')); Session::flash('message', trans('texts.updated_settings'));
@ -969,15 +968,15 @@ class AccountController extends BaseController
if (Auth::user()->account->hasFeature(FEATURE_INVOICE_SETTINGS)) { if (Auth::user()->account->hasFeature(FEATURE_INVOICE_SETTINGS)) {
$rules = []; $rules = [];
foreach ([ENTITY_INVOICE, ENTITY_QUOTE, ENTITY_CLIENT] as $entityType) { foreach ([ENTITY_INVOICE, ENTITY_QUOTE, ENTITY_CLIENT] as $entityType) {
if (Input::get("{$entityType}_number_type") == 'pattern') { if (\Request::input("{$entityType}_number_type") == 'pattern') {
$rules["{$entityType}_number_pattern"] = 'has_counter'; $rules["{$entityType}_number_pattern"] = 'has_counter';
} }
} }
if (Input::get('credit_number_enabled')) { if (\Request::input('credit_number_enabled')) {
$rules['credit_number_prefix'] = 'required_without:credit_number_pattern'; $rules['credit_number_prefix'] = 'required_without:credit_number_pattern';
$rules['credit_number_pattern'] = 'required_without:credit_number_prefix'; $rules['credit_number_pattern'] = 'required_without:credit_number_prefix';
} }
$validator = Validator::make(Input::all(), $rules); $validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) { if ($validator->fails()) {
return Redirect::to('settings/'.ACCOUNT_INVOICE_SETTINGS) return Redirect::to('settings/'.ACCOUNT_INVOICE_SETTINGS)
@ -985,47 +984,47 @@ class AccountController extends BaseController
->withInput(); ->withInput();
} else { } else {
$account = Auth::user()->account; $account = Auth::user()->account;
$account->custom_value1 = Input::get('custom_value1'); $account->custom_value1 = \Request::input('custom_value1');
$account->custom_value2 = Input::get('custom_value2'); $account->custom_value2 = \Request::input('custom_value2');
$account->custom_invoice_taxes1 = Input::get('custom_invoice_taxes1') ? true : false; $account->custom_invoice_taxes1 = \Request::input('custom_invoice_taxes1') ? true : false;
$account->custom_invoice_taxes2 = Input::get('custom_invoice_taxes2') ? true : false; $account->custom_invoice_taxes2 = \Request::input('custom_invoice_taxes2') ? true : false;
$account->custom_fields = request()->custom_fields; $account->custom_fields = request()->custom_fields;
$account->invoice_number_padding = Input::get('invoice_number_padding'); $account->invoice_number_padding = \Request::input('invoice_number_padding');
$account->invoice_number_counter = Input::get('invoice_number_counter'); $account->invoice_number_counter = \Request::input('invoice_number_counter');
$account->quote_number_prefix = Input::get('quote_number_prefix'); $account->quote_number_prefix = \Request::input('quote_number_prefix');
$account->share_counter = Input::get('share_counter') ? true : false; $account->share_counter = \Request::input('share_counter') ? true : false;
$account->invoice_terms = Input::get('invoice_terms'); $account->invoice_terms = \Request::input('invoice_terms');
$account->invoice_footer = Input::get('invoice_footer'); $account->invoice_footer = \Request::input('invoice_footer');
$account->quote_terms = Input::get('quote_terms'); $account->quote_terms = \Request::input('quote_terms');
$account->auto_convert_quote = Input::get('auto_convert_quote'); $account->auto_convert_quote = \Request::input('auto_convert_quote');
$account->auto_archive_quote = Input::get('auto_archive_quote'); $account->auto_archive_quote = \Request::input('auto_archive_quote');
$account->auto_archive_invoice = Input::get('auto_archive_invoice'); $account->auto_archive_invoice = \Request::input('auto_archive_invoice');
$account->auto_email_invoice = Input::get('auto_email_invoice'); $account->auto_email_invoice = \Request::input('auto_email_invoice');
$account->recurring_invoice_number_prefix = Input::get('recurring_invoice_number_prefix'); $account->recurring_invoice_number_prefix = \Request::input('recurring_invoice_number_prefix');
$account->client_number_prefix = trim(Input::get('client_number_prefix')); $account->client_number_prefix = trim(\Request::input('client_number_prefix'));
$account->client_number_pattern = trim(Input::get('client_number_pattern')); $account->client_number_pattern = trim(\Request::input('client_number_pattern'));
$account->client_number_counter = Input::get('client_number_counter'); $account->client_number_counter = \Request::input('client_number_counter');
$account->credit_number_counter = Input::get('credit_number_counter'); $account->credit_number_counter = \Request::input('credit_number_counter');
$account->credit_number_prefix = trim(Input::get('credit_number_prefix')); $account->credit_number_prefix = trim(\Request::input('credit_number_prefix'));
$account->credit_number_pattern = trim(Input::get('credit_number_pattern')); $account->credit_number_pattern = trim(\Request::input('credit_number_pattern'));
$account->reset_counter_frequency_id = Input::get('reset_counter_frequency_id'); $account->reset_counter_frequency_id = \Request::input('reset_counter_frequency_id');
$account->reset_counter_date = $account->reset_counter_frequency_id ? Utils::toSqlDate(Input::get('reset_counter_date')) : null; $account->reset_counter_date = $account->reset_counter_frequency_id ? Utils::toSqlDate(\Request::input('reset_counter_date')) : null;
if (Input::has('recurring_hour')) { if (Request::has('recurring_hour')) {
$account->recurring_hour = Input::get('recurring_hour'); $account->recurring_hour = \Request::input('recurring_hour');
} }
if (! $account->share_counter) { if (! $account->share_counter) {
$account->quote_number_counter = Input::get('quote_number_counter'); $account->quote_number_counter = \Request::input('quote_number_counter');
} }
foreach ([ENTITY_INVOICE, ENTITY_QUOTE, ENTITY_CLIENT] as $entityType) { foreach ([ENTITY_INVOICE, ENTITY_QUOTE, ENTITY_CLIENT] as $entityType) {
if (Input::get("{$entityType}_number_type") == 'prefix') { if (\Request::input("{$entityType}_number_type") == 'prefix') {
$account->{"{$entityType}_number_prefix"} = trim(Input::get("{$entityType}_number_prefix")); $account->{"{$entityType}_number_prefix"} = trim(\Request::input("{$entityType}_number_prefix"));
$account->{"{$entityType}_number_pattern"} = null; $account->{"{$entityType}_number_pattern"} = null;
} else { } else {
$account->{"{$entityType}_number_pattern"} = trim(Input::get("{$entityType}_number_pattern")); $account->{"{$entityType}_number_pattern"} = trim(\Request::input("{$entityType}_number_pattern"));
$account->{"{$entityType}_number_prefix"} = null; $account->{"{$entityType}_number_prefix"} = null;
} }
} }
@ -1053,27 +1052,27 @@ class AccountController extends BaseController
{ {
if (Auth::user()->account->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN)) { if (Auth::user()->account->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN)) {
$account = Auth::user()->account; $account = Auth::user()->account;
$account->hide_quantity = Input::get('hide_quantity') ? true : false; $account->hide_quantity = \Request::input('hide_quantity') ? true : false;
$account->hide_paid_to_date = Input::get('hide_paid_to_date') ? true : false; $account->hide_paid_to_date = \Request::input('hide_paid_to_date') ? true : false;
$account->all_pages_header = Input::get('all_pages_header') ? true : false; $account->all_pages_header = \Request::input('all_pages_header') ? true : false;
$account->all_pages_footer = Input::get('all_pages_footer') ? true : false; $account->all_pages_footer = \Request::input('all_pages_footer') ? true : false;
$account->invoice_embed_documents = Input::get('invoice_embed_documents') ? true : false; $account->invoice_embed_documents = \Request::input('invoice_embed_documents') ? true : false;
$account->header_font_id = Input::get('header_font_id'); $account->header_font_id = \Request::input('header_font_id');
$account->body_font_id = Input::get('body_font_id'); $account->body_font_id = \Request::input('body_font_id');
$account->primary_color = Input::get('primary_color'); $account->primary_color = \Request::input('primary_color');
$account->secondary_color = Input::get('secondary_color'); $account->secondary_color = \Request::input('secondary_color');
$account->invoice_design_id = Input::get('invoice_design_id'); $account->invoice_design_id = \Request::input('invoice_design_id');
$account->quote_design_id = Input::get('quote_design_id'); $account->quote_design_id = \Request::input('quote_design_id');
$account->font_size = intval(Input::get('font_size')); $account->font_size = intval(\Request::input('font_size'));
$account->page_size = Input::get('page_size'); $account->page_size = \Request::input('page_size');
$account->background_image_id = Document::getPrivateId(request()->background_image_id); $account->background_image_id = Document::getPrivateId(request()->background_image_id);
$labels = []; $labels = [];
foreach (Account::$customLabels as $field) { foreach (Account::$customLabels as $field) {
$labels[$field] = Input::get("labels_{$field}"); $labels[$field] = \Request::input("labels_{$field}");
} }
$account->invoice_labels = json_encode($labels); $account->invoice_labels = json_encode($labels);
$account->invoice_fields = Input::get('invoice_fields_json'); $account->invoice_fields = \Request::input('invoice_fields_json');
$account->save(); $account->save();
@ -1089,12 +1088,12 @@ class AccountController extends BaseController
private function saveNotifications() private function saveNotifications()
{ {
$user = Auth::user(); $user = Auth::user();
$user->notify_sent = Input::get('notify_sent'); $user->notify_sent = \Request::input('notify_sent');
$user->notify_viewed = Input::get('notify_viewed'); $user->notify_viewed = \Request::input('notify_viewed');
$user->notify_paid = Input::get('notify_paid'); $user->notify_paid = \Request::input('notify_paid');
$user->notify_approved = Input::get('notify_approved'); $user->notify_approved = \Request::input('notify_approved');
$user->only_notify_owned = Input::get('only_notify_owned'); $user->only_notify_owned = \Request::input('only_notify_owned');
$user->slack_webhook_url = Input::get('slack_webhook_url'); $user->slack_webhook_url = \Request::input('slack_webhook_url');
$user->save(); $user->save();
$account = $user->account; $account = $user->account;
@ -1117,8 +1116,8 @@ class AccountController extends BaseController
$this->accountRepo->save($request->input(), $account); $this->accountRepo->save($request->input(), $account);
/* Logo image file */ /* Logo image file */
if ($uploaded = Input::file('logo')) { if ($uploaded = Request::file('logo')) {
$path = Input::file('logo')->getRealPath(); $path = Request::file('logo')->getRealPath();
$disk = $account->getLogoDisk(); $disk = $account->getLogoDisk();
$extension = strtolower($uploaded->getClientOriginalExtension()); $extension = strtolower($uploaded->getClientOriginalExtension());
@ -1204,7 +1203,7 @@ class AccountController extends BaseController
{ {
/** @var \App\Models\User $user */ /** @var \App\Models\User $user */
$user = Auth::user(); $user = Auth::user();
$email = trim(strtolower(Input::get('email'))); $email = trim(strtolower(\Request::input('email')));
if (! \App\Models\LookupUser::validateField('email', $email, $user)) { if (! \App\Models\LookupUser::validateField('email', $email, $user)) {
return Redirect::to('settings/' . ACCOUNT_USER_DETAILS) return Redirect::to('settings/' . ACCOUNT_USER_DETAILS)
@ -1218,34 +1217,34 @@ class AccountController extends BaseController
$rules['phone'] = 'required'; $rules['phone'] = 'required';
} }
$validator = Validator::make(Input::all(), $rules); $validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) { if ($validator->fails()) {
return Redirect::to('settings/'.ACCOUNT_USER_DETAILS) return Redirect::to('settings/'.ACCOUNT_USER_DETAILS)
->withErrors($validator) ->withErrors($validator)
->withInput(); ->withInput();
} else { } else {
$user->first_name = trim(Input::get('first_name')); $user->first_name = trim(\Request::input('first_name'));
$user->last_name = trim(Input::get('last_name')); $user->last_name = trim(\Request::input('last_name'));
$user->username = $email; $user->username = $email;
$user->email = $email; $user->email = $email;
$user->phone = trim(Input::get('phone')); $user->phone = trim(\Request::input('phone'));
$user->dark_mode = Input::get('dark_mode'); $user->dark_mode = \Request::input('dark_mode');
if (! Auth::user()->is_admin) { if (! Auth::user()->is_admin) {
$user->notify_sent = Input::get('notify_sent'); $user->notify_sent = \Request::input('notify_sent');
$user->notify_viewed = Input::get('notify_viewed'); $user->notify_viewed = \Request::input('notify_viewed');
$user->notify_paid = Input::get('notify_paid'); $user->notify_paid = \Request::input('notify_paid');
$user->notify_approved = Input::get('notify_approved'); $user->notify_approved = \Request::input('notify_approved');
$user->only_notify_owned = Input::get('only_notify_owned'); $user->only_notify_owned = \Request::input('only_notify_owned');
} }
if ($user->google_2fa_secret && ! Input::get('enable_two_factor')) { if ($user->google_2fa_secret && ! \Request::input('enable_two_factor')) {
$user->google_2fa_secret = null; $user->google_2fa_secret = null;
} }
if (Utils::isNinja()) { if (Utils::isNinja()) {
if (Input::get('referral_code') && ! $user->referral_code) { if (\Request::input('referral_code') && ! $user->referral_code) {
$user->referral_code = strtolower(str_random(RANDOM_KEY_LENGTH)); $user->referral_code = strtolower(str_random(RANDOM_KEY_LENGTH));
} }
} }
@ -1267,15 +1266,15 @@ class AccountController extends BaseController
/** @var \App\Models\Account $account */ /** @var \App\Models\Account $account */
$account = Auth::user()->account; $account = Auth::user()->account;
$account->timezone_id = Input::get('timezone_id') ? Input::get('timezone_id') : null; $account->timezone_id = \Request::input('timezone_id') ? \Request::input('timezone_id') : null;
$account->date_format_id = Input::get('date_format_id') ? Input::get('date_format_id') : null; $account->date_format_id = \Request::input('date_format_id') ? \Request::input('date_format_id') : null;
$account->datetime_format_id = Input::get('datetime_format_id') ? Input::get('datetime_format_id') : null; $account->datetime_format_id = \Request::input('datetime_format_id') ? \Request::input('datetime_format_id') : null;
$account->currency_id = Input::get('currency_id') ? Input::get('currency_id') : 1; // US Dollar $account->currency_id = \Request::input('currency_id') ? \Request::input('currency_id') : 1; // US Dollar
$account->language_id = Input::get('language_id') ? Input::get('language_id') : 1; // English $account->language_id = \Request::input('language_id') ? \Request::input('language_id') : 1; // English
$account->military_time = Input::get('military_time') ? true : false; $account->military_time = \Request::input('military_time') ? true : false;
$account->show_currency_code = Input::get('show_currency_code') ? true : false; $account->show_currency_code = \Request::input('show_currency_code') ? true : false;
$account->start_of_week = Input::get('start_of_week') ? Input::get('start_of_week') : 0; $account->start_of_week = \Request::input('start_of_week') ? \Request::input('start_of_week') : 0;
$account->financial_year_start = Input::get('financial_year_start') ? Input::get('financial_year_start') : null; $account->financial_year_start = \Request::input('financial_year_start') ? \Request::input('financial_year_start') : null;
$account->save(); $account->save();
event(new UserSettingsChanged()); event(new UserSettingsChanged());
@ -1291,10 +1290,10 @@ class AccountController extends BaseController
private function saveOnlinePayments() private function saveOnlinePayments()
{ {
$account = Auth::user()->account; $account = Auth::user()->account;
$account->token_billing_type_id = Input::get('token_billing_type_id'); $account->token_billing_type_id = \Request::input('token_billing_type_id');
$account->auto_bill_on_due_date = boolval(Input::get('auto_bill_on_due_date')); $account->auto_bill_on_due_date = boolval(\Request::input('auto_bill_on_due_date'));
$account->gateway_fee_enabled = boolval(Input::get('gateway_fee_enabled')); $account->gateway_fee_enabled = boolval(\Request::input('gateway_fee_enabled'));
$account->send_item_details = boolval(Input::get('send_item_details')); $account->send_item_details = boolval(\Request::input('send_item_details'));
$account->save(); $account->save();
@ -1332,7 +1331,7 @@ class AccountController extends BaseController
*/ */
public function checkEmail() public function checkEmail()
{ {
$email = trim(strtolower(Input::get('email'))); $email = trim(strtolower(\Request::input('email')));
$user = Auth::user(); $user = Auth::user();
if (! \App\Models\LookupUser::validateField('email', $email, $user)) { if (! \App\Models\LookupUser::validateField('email', $email, $user)) {
@ -1370,16 +1369,16 @@ class AccountController extends BaseController
$rules['new_email'] .= ',' . Auth::user()->id . ',id'; $rules['new_email'] .= ',' . Auth::user()->id . ',id';
} }
$validator = Validator::make(Input::all(), $rules); $validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) { if ($validator->fails()) {
return ''; return '';
} }
$firstName = trim(Input::get('new_first_name')); $firstName = trim(\Request::input('new_first_name'));
$lastName = trim(Input::get('new_last_name')); $lastName = trim(\Request::input('new_last_name'));
$email = trim(strtolower(Input::get('new_email'))); $email = trim(strtolower(\Request::input('new_email')));
$password = trim(Input::get('new_password')); $password = trim(\Request::input('new_password'));
if (! \App\Models\LookupUser::validateField('email', $email, $user)) { if (! \App\Models\LookupUser::validateField('email', $email, $user)) {
return ''; return '';
@ -1408,7 +1407,7 @@ class AccountController extends BaseController
$user->account->startTrial(PLAN_PRO); $user->account->startTrial(PLAN_PRO);
if (Input::get('go_pro') == 'true') { if (\Request::input('go_pro') == 'true') {
session([REQUESTED_PRO_PLAN => true]); session([REQUESTED_PRO_PLAN => true]);
} }
@ -1422,15 +1421,15 @@ class AccountController extends BaseController
public function doRegister() public function doRegister()
{ {
$affiliate = Affiliate::where('affiliate_key', '=', SELF_HOST_AFFILIATE_KEY)->first(); $affiliate = Affiliate::where('affiliate_key', '=', SELF_HOST_AFFILIATE_KEY)->first();
$email = trim(Input::get('email')); $email = trim(\Request::input('email'));
if (! $email || $email == TEST_USERNAME) { if (! $email || $email == TEST_USERNAME) {
return RESULT_FAILURE; return RESULT_FAILURE;
} }
$license = new License(); $license = new License();
$license->first_name = Input::get('first_name'); $license->first_name = \Request::input('first_name');
$license->last_name = Input::get('last_name'); $license->last_name = \Request::input('last_name');
$license->email = $email; $license->email = $email;
$license->transaction_reference = Request::getClientIp(); $license->transaction_reference = Request::getClientIp();
$license->license_key = Utils::generateLicense(); $license->license_key = Utils::generateLicense();
@ -1457,7 +1456,7 @@ class AccountController extends BaseController
*/ */
public function cancelAccount() public function cancelAccount()
{ {
if ($reason = trim(Input::get('reason'))) { if ($reason = trim(\Request::input('reason'))) {
$email = Auth::user()->email; $email = Auth::user()->email;
$name = Auth::user()->getDisplayName(); $name = Auth::user()->getDisplayName();
@ -1550,7 +1549,7 @@ class AccountController extends BaseController
*/ */
public function previewEmail(TemplateService $templateService) public function previewEmail(TemplateService $templateService)
{ {
$template = Input::get('template'); $template = \Request::input('template');
$invitation = \App\Models\Invitation::scope() $invitation = \App\Models\Invitation::scope()
->with('invoice.client.contacts') ->with('invoice.client.contacts')
->first(); ->first();

View File

@ -8,8 +8,8 @@ use App\Models\AccountGateway;
use App\Models\Gateway; use App\Models\Gateway;
use App\Services\AccountGatewayService; use App\Services\AccountGatewayService;
use Auth; use Auth;
use Input;
use Redirect; use Redirect;
use Request;
use Session; use Session;
use stdClass; use stdClass;
use URL; use URL;
@ -88,9 +88,9 @@ class AccountGatewayController extends BaseController
Session::now('warning', trans('texts.enable_https')); Session::now('warning', trans('texts.enable_https'));
} }
$account = Auth::user()->account; $account = Auth::user()->account;
$accountGatewaysIds = $account->gatewayIds(); $accountGatewaysIds = $account->gatewayIds();
$wepay = Input::get('wepay'); $wepay = \Request::input('wepay');
$data = self::getViewModel(); $data = self::getViewModel();
$data['url'] = 'gateways'; $data['url'] = 'gateways';
@ -158,9 +158,9 @@ class AccountGatewayController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('bulk_action'); $action = \Request::input('bulk_action');
$ids = Input::get('bulk_public_id'); $ids = \Request::input('bulk_public_id');
$count = $this->accountGatewayService->bulk($ids, $action); $count = $this->accountGatewayService->bulk($ids, $action);
Session::flash('message', trans("texts.{$action}d_account_gateway")); Session::flash('message', trans("texts.{$action}d_account_gateway"));
@ -174,8 +174,8 @@ class AccountGatewayController extends BaseController
*/ */
public function save($accountGatewayPublicId = false) public function save($accountGatewayPublicId = false)
{ {
$gatewayId = Input::get('primary_gateway_id') ?: Input::get('secondary_gateway_id'); $gatewayId = \Request::input('primary_gateway_id') ?: \Request::input('secondary_gateway_id');
$gateway = Gateway::findOrFail($gatewayId); $gateway = Gateway::findOrFail($gatewayId);
$rules = []; $rules = [];
$fields = $gateway->getFields(); $fields = $gateway->getFields();
@ -208,16 +208,16 @@ class AccountGatewayController extends BaseController
} }
} }
$creditcards = Input::get('creditCardTypes'); $creditcards = \Request::input('creditCardTypes');
$validator = Validator::make(Input::all(), $rules); $validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) { if ($validator->fails()) {
$url = $accountGatewayPublicId ? "/gateways/{$accountGatewayPublicId}/edit" : 'gateways/create?other_providers=' . ($gatewayId == GATEWAY_WEPAY ? 'false' : 'true'); $url = $accountGatewayPublicId ? "/gateways/{$accountGatewayPublicId}/edit" : 'gateways/create?other_providers=' . ($gatewayId == GATEWAY_WEPAY ? 'false' : 'true');
return Redirect::to($url) return Redirect::to($url)
->withErrors($validator) ->withErrors($validator)
->withInput(); ->withInput();
} else { } else {
$account = Account::with('account_gateways')->findOrFail(Auth::user()->account_id); $account = Account::with('account_gateways')->findOrFail(Auth::user()->account_id);
$oldConfig = null; $oldConfig = null;
if ($accountGatewayPublicId) { if ($accountGatewayPublicId) {
@ -250,7 +250,7 @@ class AccountGatewayController extends BaseController
if ($gatewayId != GATEWAY_WEPAY) { if ($gatewayId != GATEWAY_WEPAY) {
foreach ($fields as $field => $details) { foreach ($fields as $field => $details) {
$value = trim(Input::get($gateway->id . '_' . $field)); $value = trim(\Request::input($gateway->id . '_' . $field));
// if the new value is masked use the original value // if the new value is masked use the original value
if ($oldConfig && $value && $value === str_repeat('*', strlen($value))) { if ($oldConfig && $value && $value === str_repeat('*', strlen($value))) {
$value = $oldConfig->$field; $value = $oldConfig->$field;
@ -265,28 +265,28 @@ class AccountGatewayController extends BaseController
$config = clone $oldConfig; $config = clone $oldConfig;
} }
$publishableKey = trim(Input::get('publishable_key')); $publishableKey = trim(\Request::input('publishable_key'));
if ($publishableKey = str_replace('*', '', $publishableKey)) { if ($publishableKey = str_replace('*', '', $publishableKey)) {
$config->publishableKey = $publishableKey; $config->publishableKey = $publishableKey;
} elseif ($oldConfig && property_exists($oldConfig, 'publishableKey')) { } elseif ($oldConfig && property_exists($oldConfig, 'publishableKey')) {
$config->publishableKey = $oldConfig->publishableKey; $config->publishableKey = $oldConfig->publishableKey;
} }
$plaidClientId = trim(Input::get('plaid_client_id')); $plaidClientId = trim(\Request::input('plaid_client_id'));
if (! $plaidClientId || $plaidClientId = str_replace('*', '', $plaidClientId)) { if (! $plaidClientId || $plaidClientId = str_replace('*', '', $plaidClientId)) {
$config->plaidClientId = $plaidClientId; $config->plaidClientId = $plaidClientId;
} elseif ($oldConfig && property_exists($oldConfig, 'plaidClientId')) { } elseif ($oldConfig && property_exists($oldConfig, 'plaidClientId')) {
$config->plaidClientId = $oldConfig->plaidClientId; $config->plaidClientId = $oldConfig->plaidClientId;
} }
$plaidSecret = trim(Input::get('plaid_secret')); $plaidSecret = trim(\Request::input('plaid_secret'));
if (! $plaidSecret || $plaidSecret = str_replace('*', '', $plaidSecret)) { if (! $plaidSecret || $plaidSecret = str_replace('*', '', $plaidSecret)) {
$config->plaidSecret = $plaidSecret; $config->plaidSecret = $plaidSecret;
} elseif ($oldConfig && property_exists($oldConfig, 'plaidSecret')) { } elseif ($oldConfig && property_exists($oldConfig, 'plaidSecret')) {
$config->plaidSecret = $oldConfig->plaidSecret; $config->plaidSecret = $oldConfig->plaidSecret;
} }
$plaidPublicKey = trim(Input::get('plaid_public_key')); $plaidPublicKey = trim(\Request::input('plaid_public_key'));
if (! $plaidPublicKey || $plaidPublicKey = str_replace('*', '', $plaidPublicKey)) { if (! $plaidPublicKey || $plaidPublicKey = str_replace('*', '', $plaidPublicKey)) {
$config->plaidPublicKey = $plaidPublicKey; $config->plaidPublicKey = $plaidPublicKey;
} elseif ($oldConfig && property_exists($oldConfig, 'plaidPublicKey')) { } elseif ($oldConfig && property_exists($oldConfig, 'plaidPublicKey')) {
@ -294,11 +294,11 @@ class AccountGatewayController extends BaseController
} }
if ($gatewayId == GATEWAY_STRIPE) { if ($gatewayId == GATEWAY_STRIPE) {
$config->enableAlipay = boolval(Input::get('enable_alipay')); $config->enableAlipay = boolval(\Request::input('enable_alipay'));
$config->enableSofort = boolval(Input::get('enable_sofort')); $config->enableSofort = boolval(\Request::input('enable_sofort'));
$config->enableSepa = boolval(Input::get('enable_sepa')); $config->enableSepa = boolval(\Request::input('enable_sepa'));
$config->enableBitcoin = boolval(Input::get('enable_bitcoin')); $config->enableBitcoin = boolval(\Request::input('enable_bitcoin'));
$config->enableApplePay = boolval(Input::get('enable_apple_pay')); $config->enableApplePay = boolval(\Request::input('enable_apple_pay'));
if ($config->enableApplePay && $uploadedFile = request()->file('apple_merchant_id')) { if ($config->enableApplePay && $uploadedFile = request()->file('apple_merchant_id')) {
$config->appleMerchantId = File::get($uploadedFile); $config->appleMerchantId = File::get($uploadedFile);
@ -308,11 +308,11 @@ class AccountGatewayController extends BaseController
} }
if ($gatewayId == GATEWAY_STRIPE || $gatewayId == GATEWAY_WEPAY) { if ($gatewayId == GATEWAY_STRIPE || $gatewayId == GATEWAY_WEPAY) {
$config->enableAch = boolval(Input::get('enable_ach')); $config->enableAch = boolval(\Request::input('enable_ach'));
} }
if ($gatewayId == GATEWAY_BRAINTREE) { if ($gatewayId == GATEWAY_BRAINTREE) {
$config->enablePayPal = boolval(Input::get('enable_paypal')); $config->enablePayPal = boolval(\Request::input('enable_paypal'));
} }
$cardCount = 0; $cardCount = 0;
@ -323,9 +323,9 @@ class AccountGatewayController extends BaseController
} }
$accountGateway->accepted_credit_cards = $cardCount; $accountGateway->accepted_credit_cards = $cardCount;
$accountGateway->show_address = Input::get('show_address') ? true : false; $accountGateway->show_address = \Request::input('show_address') ? true : false;
$accountGateway->show_shipping_address = Input::get('show_shipping_address') ? true : false; $accountGateway->show_shipping_address = \Request::input('show_shipping_address') ? true : false;
$accountGateway->update_address = Input::get('update_address') ? true : false; $accountGateway->update_address = \Request::input('update_address') ? true : false;
$accountGateway->setConfig($config); $accountGateway->setConfig($config);
if ($accountGatewayPublicId) { if ($accountGatewayPublicId) {
@ -395,7 +395,7 @@ class AccountGatewayController extends BaseController
'country' => 'required|in:US,CA,GB', 'country' => 'required|in:US,CA,GB',
]; ];
$validator = Validator::make(Input::all(), $rules); $validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) { if ($validator->fails()) {
return Redirect::to('gateways/create') return Redirect::to('gateways/create')
@ -404,9 +404,9 @@ class AccountGatewayController extends BaseController
} }
if (! $user->email) { if (! $user->email) {
$user->email = trim(Input::get('email')); $user->email = trim(\Request::input('email'));
$user->first_name = trim(Input::get('first_name')); $user->first_name = trim(\Request::input('first_name'));
$user->last_name = trim(Input::get('last_name')); $user->last_name = trim(\Request::input('last_name'));
$user->save(); $user->save();
} }
@ -414,16 +414,16 @@ class AccountGatewayController extends BaseController
$wepay = Utils::setupWePay(); $wepay = Utils::setupWePay();
$userDetails = [ $userDetails = [
'client_id' => WEPAY_CLIENT_ID, 'client_id' => WEPAY_CLIENT_ID,
'client_secret' => WEPAY_CLIENT_SECRET, 'client_secret' => WEPAY_CLIENT_SECRET,
'email' => Input::get('email'), 'email' => \Request::input('email'),
'first_name' => Input::get('first_name'), 'first_name' => \Request::input('first_name'),
'last_name' => Input::get('last_name'), 'last_name' => \Request::input('last_name'),
'original_ip' => \Request::getClientIp(true), 'original_ip' => \Request::getClientIp(true),
'original_device' => \Request::server('HTTP_USER_AGENT'), 'original_device' => \Request::server('HTTP_USER_AGENT'),
'tos_acceptance_time' => time(), 'tos_acceptance_time' => time(),
'redirect_uri' => URL::to('gateways'), 'redirect_uri' => URL::to('gateways'),
'scope' => 'manage_accounts,collect_payments,view_user,preapprove_payments,send_money', 'scope' => 'manage_accounts,collect_payments,view_user,preapprove_payments,send_money',
]; ];
$wepayUser = $wepay->request('user/register/', $userDetails); $wepayUser = $wepay->request('user/register/', $userDetails);
@ -434,18 +434,18 @@ class AccountGatewayController extends BaseController
$wepay = new WePay($accessToken); $wepay = new WePay($accessToken);
$accountDetails = [ $accountDetails = [
'name' => Input::get('company_name'), 'name' => \Request::input('company_name'),
'description' => trans('texts.wepay_account_description'), 'description' => trans('texts.wepay_account_description'),
'theme_object' => json_decode(WEPAY_THEME), 'theme_object' => json_decode(WEPAY_THEME),
'callback_uri' => $accountGateway->getWebhookUrl(), 'callback_uri' => $accountGateway->getWebhookUrl(),
'rbits' => $account->present()->rBits, 'rbits' => $account->present()->rBits,
'country' => Input::get('country'), 'country' => \Request::input('country'),
]; ];
if (Input::get('country') == 'CA') { if (\Request::input('country') == 'CA') {
$accountDetails['currencies'] = ['CAD']; $accountDetails['currencies'] = ['CAD'];
$accountDetails['country_options'] = ['debit_opt_in' => boolval(Input::get('debit_cards'))]; $accountDetails['country_options'] = ['debit_opt_in' => boolval(\Request::input('debit_cards'))];
} elseif (Input::get('country') == 'GB') { } elseif (\Request::input('country') == 'GB') {
$accountDetails['currencies'] = ['GBP']; $accountDetails['currencies'] = ['GBP'];
} }
@ -464,14 +464,14 @@ class AccountGatewayController extends BaseController
$accountGateway->gateway_id = GATEWAY_WEPAY; $accountGateway->gateway_id = GATEWAY_WEPAY;
$accountGateway->setConfig([ $accountGateway->setConfig([
'userId' => $wepayUser->user_id, 'userId' => $wepayUser->user_id,
'accessToken' => $accessToken, 'accessToken' => $accessToken,
'tokenType' => $wepayUser->token_type, 'tokenType' => $wepayUser->token_type,
'tokenExpires' => $accessTokenExpires, 'tokenExpires' => $accessTokenExpires,
'accountId' => $wepayAccount->account_id, 'accountId' => $wepayAccount->account_id,
'state' => $wepayAccount->state, 'state' => $wepayAccount->state,
'testMode' => WEPAY_ENVIRONMENT == WEPAY_STAGE, 'testMode' => WEPAY_ENVIRONMENT == WEPAY_STAGE,
'country' => Input::get('country'), 'country' => \Request::input('country'),
]); ]);
if ($confirmationRequired) { if ($confirmationRequired) {
@ -522,22 +522,22 @@ class AccountGatewayController extends BaseController
*/ */
public function savePaymentGatewayLimits() public function savePaymentGatewayLimits()
{ {
$gateway_type_id = intval(Input::get('gateway_type_id')); $gateway_type_id = intval(\Request::input('gateway_type_id'));
$gateway_settings = AccountGatewaySettings::scope()->where('gateway_type_id', '=', $gateway_type_id)->first(); $gateway_settings = AccountGatewaySettings::scope()->where('gateway_type_id', '=', $gateway_type_id)->first();
if (! $gateway_settings) { if ( ! $gateway_settings) {
$gateway_settings = AccountGatewaySettings::createNew(); $gateway_settings = AccountGatewaySettings::createNew();
$gateway_settings->gateway_type_id = $gateway_type_id; $gateway_settings->gateway_type_id = $gateway_type_id;
} }
$gateway_settings->min_limit = Input::get('limit_min_enable') ? intval(Input::get('limit_min')) : null; $gateway_settings->min_limit = \Request::input('limit_min_enable') ? intval(\Request::input('limit_min')) : null;
$gateway_settings->max_limit = Input::get('limit_max_enable') ? intval(Input::get('limit_max')) : null; $gateway_settings->max_limit = \Request::input('limit_max_enable') ? intval(\Request::input('limit_max')) : null;
if ($gateway_settings->max_limit !== null && $gateway_settings->min_limit > $gateway_settings->max_limit) { if ($gateway_settings->max_limit !== null && $gateway_settings->min_limit > $gateway_settings->max_limit) {
$gateway_settings->max_limit = $gateway_settings->min_limit; $gateway_settings->max_limit = $gateway_settings->min_limit;
} }
$gateway_settings->fill(Input::all()); $gateway_settings->fill(Request::all());
$gateway_settings->save(); $gateway_settings->save();
Session::flash('message', trans('texts.updated_settings')); Session::flash('message', trans('texts.updated_settings'));

View File

@ -16,7 +16,6 @@ use Config;
use DB; use DB;
use Event; use Event;
use Exception; use Exception;
use Input;
use Redirect; use Redirect;
use Response; use Response;
use Session; use Session;
@ -58,17 +57,17 @@ class AppController extends BaseController
} }
$valid = false; $valid = false;
$test = Input::get('test'); $test = \Request::input('test');
$app = Input::get('app'); $app = \Request::input('app');
$app['key'] = env('APP_KEY') ?: strtolower(str_random(RANDOM_KEY_LENGTH)); $app['key'] = env('APP_KEY') ?: strtolower(str_random(RANDOM_KEY_LENGTH));
$app['debug'] = Input::get('debug') ? 'true' : 'false'; $app['debug'] = \Request::input('debug') ? 'true' : 'false';
$app['https'] = Input::get('https') ? 'true' : 'false'; $app['https'] = \Request::input('https') ? 'true' : 'false';
$database = Input::get('database'); $database = \Request::input('database');
$dbType = 'mysql'; // $database['default']; $dbType = 'mysql'; // $database['default'];
$database['connections'] = [$dbType => $database['type']]; $database['connections'] = [$dbType => $database['type']];
$mail = Input::get('mail'); $mail = \Request::input('mail');
if ($test == 'mail') { if ($test == 'mail') {
return self::testMail($mail); return self::testMail($mail);
@ -137,10 +136,10 @@ class AppController extends BaseController
Artisan::call('db:seed', ['--force' => true, '--class' => 'UpdateSeeder']); Artisan::call('db:seed', ['--force' => true, '--class' => 'UpdateSeeder']);
if (! Account::count()) { if (! Account::count()) {
$firstName = trim(Input::get('first_name')); $firstName = trim(\Request::input('first_name'));
$lastName = trim(Input::get('last_name')); $lastName = trim(\Request::input('last_name'));
$email = trim(strtolower(Input::get('email'))); $email = trim(strtolower(\Request::input('email')));
$password = trim(Input::get('password')); $password = trim(\Request::input('password'));
$account = $this->accountRepo->create($firstName, $lastName, $email, $password); $account = $this->accountRepo->create($firstName, $lastName, $email, $password);
$user = $account->users()->first(); $user = $account->users()->first();
@ -167,13 +166,13 @@ class AppController extends BaseController
return Redirect::to('/settings/system_settings'); return Redirect::to('/settings/system_settings');
} }
$app = Input::get('app'); $app = \Request::input('app');
$db = Input::get('database'); $db = \Request::input('database');
$mail = Input::get('mail'); $mail = \Request::input('mail');
$_ENV['APP_URL'] = $app['url']; $_ENV['APP_URL'] = $app['url'];
$_ENV['APP_DEBUG'] = Input::get('debug') ? 'true' : 'false'; $_ENV['APP_DEBUG'] = \Request::input('debug') ? 'true' : 'false';
$_ENV['REQUIRE_HTTPS'] = Input::get('https') ? 'true' : 'false'; $_ENV['REQUIRE_HTTPS'] = \Request::input('https') ? 'true' : 'false';
$_ENV['DB_TYPE'] = 'mysql'; // $db['default']; $_ENV['DB_TYPE'] = 'mysql'; // $db['default'];
$_ENV['DB_HOST'] = $db['type']['host']; $_ENV['DB_HOST'] = $db['type']['host'];
@ -314,7 +313,7 @@ class AppController extends BaseController
Session::flush(); Session::flush();
Artisan::call('migrate', ['--force' => true]); Artisan::call('migrate', ['--force' => true]);
Artisan::call('db:seed', ['--force' => true, '--class' => 'UpdateSeeder']); Artisan::call('db:seed', ['--force' => true, '--class' => 'UpdateSeeder']);
Event::fire(new UserSettingsChanged()); Event::dispatch(new UserSettingsChanged());
// legacy fix: check cipher is in .env file // legacy fix: check cipher is in .env file
if (! env('APP_CIPHER')) { if (! env('APP_CIPHER')) {
@ -363,15 +362,15 @@ class AppController extends BaseController
public function emailBounced() public function emailBounced()
{ {
$messageId = Input::get('MessageID'); $messageId = \Request::input('MessageID');
$error = Input::get('Name') . ': ' . Input::get('Description'); $error = \Request::input('Name') . ': ' . \Request::input('Description');
return $this->emailService->markBounced($messageId, $error) ? RESULT_SUCCESS : RESULT_FAILURE; return $this->emailService->markBounced($messageId, $error) ? RESULT_SUCCESS : RESULT_FAILURE;
} }
public function emailOpened() public function emailOpened()
{ {
$messageId = Input::get('MessageID'); $messageId = \Request::input('MessageID');
return $this->emailService->markOpened($messageId) ? RESULT_SUCCESS : RESULT_FAILURE; return $this->emailService->markOpened($messageId) ? RESULT_SUCCESS : RESULT_FAILURE;
@ -409,7 +408,7 @@ class AppController extends BaseController
public function stats() public function stats()
{ {
if (! hash_equals(Input::get('password') ?: '', env('RESELLER_PASSWORD'))) { if (! hash_equals(\Request::input('password') ?: '', env('RESELLER_PASSWORD'))) {
sleep(3); sleep(3);
return ''; return '';

View File

@ -158,7 +158,7 @@ class LoginController extends Controller
} }
} }
Event::fire(new UserLoggedIn()); Event::dispatch(new UserLoggedIn());
return redirect()->intended($this->redirectTo); return redirect()->intended($this->redirectTo);
} }
@ -188,11 +188,11 @@ class LoginController extends Controller
$key = $userId . ':' . $request->totp; $key = $userId . ':' . $request->totp;
//use cache to store token to blacklist //use cache to store token to blacklist
Cache::add($key, true, 4); Cache::add($key, true, 4 * 60);
//login and redirect user //login and redirect user
auth()->loginUsingId($userId); auth()->loginUsingId($userId);
Event::fire(new UserLoggedIn()); Event::dispatch(new UserLoggedIn());
if ($trust = request()->trust) { if ($trust = request()->trust) {
$user = auth()->user(); $user = auth()->user();

View File

@ -42,7 +42,7 @@ class ResetPasswordController extends Controller
$this->middleware('guest'); $this->middleware('guest');
} }
protected function sendResetResponse($response) protected function sendResetResponse(Request $request, $response)
{ {
$user = auth()->user(); $user = auth()->user();
@ -51,8 +51,8 @@ class ResetPasswordController extends Controller
session(['2fa:user:id' => $user->id]); session(['2fa:user:id' => $user->id]);
return redirect('/validate_two_factor/' . $user->account->account_key); return redirect('/validate_two_factor/' . $user->account->account_key);
} else { } else {
Event::fire(new UserLoggedIn()); Event::dispatch(new UserLoggedIn());
return $this->traitSendResetResponse($response); return $this->traitSendResetResponse($request, $response);
} }
} }

View File

@ -12,7 +12,6 @@ use Cache;
use Crypt; use Crypt;
use File; use File;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use Utils; use Utils;
@ -74,8 +73,8 @@ class BankAccountController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('bulk_action'); $action = \Request::input('bulk_action');
$ids = Input::get('bulk_public_id'); $ids = \Request::input('bulk_public_id');
$count = $this->bankAccountService->bulk($ids, $action); $count = $this->bankAccountService->bulk($ids, $action);
Session::flash('message', trans('texts.archived_bank_account')); Session::flash('message', trans('texts.archived_bank_account'));
@ -85,9 +84,9 @@ class BankAccountController extends BaseController
public function validateAccount() public function validateAccount()
{ {
$publicId = Input::get('public_id'); $publicId = \Request::input('public_id');
$username = trim(Input::get('bank_username')); $username = trim(\Request::input('bank_username'));
$password = trim(Input::get('bank_password')); $password = trim(\Request::input('bank_password'));
if ($publicId) { if ($publicId) {
$bankAccount = BankAccount::scope($publicId)->firstOrFail(); $bankAccount = BankAccount::scope($publicId)->firstOrFail();
@ -100,11 +99,11 @@ class BankAccountController extends BaseController
$bankId = $bankAccount->bank_id; $bankId = $bankAccount->bank_id;
} else { } else {
$bankAccount = new BankAccount; $bankAccount = new BankAccount;
$bankAccount->bank_id = Input::get('bank_id'); $bankAccount->bank_id = \Request::input('bank_id');
} }
$bankAccount->app_version = Input::get('app_version'); $bankAccount->app_version = \Request::input('app_version');
$bankAccount->ofx_version = Input::get('ofx_version'); $bankAccount->ofx_version = \Request::input('ofx_version');
if ($publicId) { if ($publicId) {
$bankAccount->save(); $bankAccount->save();
@ -115,18 +114,18 @@ class BankAccountController extends BaseController
public function store(CreateBankAccountRequest $request) public function store(CreateBankAccountRequest $request)
{ {
$bankAccount = $this->bankAccountRepo->save(Input::all()); $bankAccount = $this->bankAccountRepo->save(Request::all());
$bankId = Input::get('bank_id'); $bankId = \Request::input('bank_id');
$username = trim(Input::get('bank_username')); $username = trim(\Request::input('bank_username'));
$password = trim(Input::get('bank_password')); $password = trim(\Request::input('bank_password'));
return json_encode($this->bankAccountService->loadBankAccounts($bankAccount, $username, $password, true)); return json_encode($this->bankAccountService->loadBankAccounts($bankAccount, $username, $password, true));
} }
public function importExpenses($bankId) public function importExpenses($bankId)
{ {
return $this->bankAccountService->importExpenses($bankId, Input::all()); return $this->bankAccountService->importExpenses($bankId, Request::all());
} }
public function showImportOFX() public function showImportOFX()

View File

@ -5,7 +5,6 @@ namespace App\Http\Controllers;
use App\Models\EntityModel; use App\Models\EntityModel;
use App\Ninja\Serializers\ArraySerializer; use App\Ninja\Serializers\ArraySerializer;
use Auth; use Auth;
use Input;
use League\Fractal\Manager; use League\Fractal\Manager;
use League\Fractal\Pagination\IlluminatePaginatorAdapter; use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection; use League\Fractal\Resource\Collection;
@ -56,11 +55,11 @@ class BaseAPIController extends Controller
{ {
$this->manager = new Manager(); $this->manager = new Manager();
if ($include = Request::get('include')) { if ($include = \Request::get('include')) {
$this->manager->parseIncludes($include); $this->manager->parseIncludes($include);
} }
$this->serializer = Request::get('serializer') ?: API_SERIALIZER_ARRAY; $this->serializer = \Request::get('serializer') ?: API_SERIALIZER_ARRAY;
if ($this->serializer === API_SERIALIZER_JSON) { if ($this->serializer === API_SERIALIZER_JSON) {
$this->manager->setSerializer(new JsonApiSerializer()); $this->manager->setSerializer(new JsonApiSerializer());
@ -92,24 +91,24 @@ class BaseAPIController extends Controller
protected function listResponse($query) protected function listResponse($query)
{ {
$transformerClass = EntityModel::getTransformerName($this->entityType); $transformerClass = EntityModel::getTransformerName($this->entityType);
$transformer = new $transformerClass(Auth::user()->account, Input::get('serializer')); $transformer = new $transformerClass(Auth::user()->account, \Request::input('serializer'));
$includes = $transformer->getDefaultIncludes(); $includes = $transformer->getDefaultIncludes();
$includes = $this->getRequestIncludes($includes); $includes = $this->getRequestIncludes($includes);
$query->with($includes); $query->with($includes);
if (Input::get('filter_active')) { if (\Request::input('filter_active')) {
$query->whereNull('deleted_at'); $query->whereNull('deleted_at');
} }
if (Input::get('updated_at') > 0) { if (\Request::input('updated_at') > 0) {
$updatedAt = intval(Input::get('updated_at')); $updatedAt = intval(\Request::input('updated_at'));
$query->where('updated_at', '>=', date('Y-m-d H:i:s', $updatedAt)); $query->where('updated_at', '>=', date('Y-m-d H:i:s', $updatedAt));
} }
if (Input::get('client_id') > 0) { if (\Request::input('client_id') > 0) {
$clientPublicId = Input::get('client_id'); $clientPublicId = \Request::input('client_id');
$filter = function ($query) use ($clientPublicId) { $filter = function ($query) use ($clientPublicId) {
$query->where('public_id', '=', $clientPublicId); $query->where('public_id', '=', $clientPublicId);
}; };
@ -136,7 +135,7 @@ class BaseAPIController extends Controller
} }
$transformerClass = EntityModel::getTransformerName($this->entityType); $transformerClass = EntityModel::getTransformerName($this->entityType);
$transformer = new $transformerClass(Auth::user()->account, Input::get('serializer')); $transformer = new $transformerClass(Auth::user()->account, \Request::input('serializer'));
$data = $this->createItem($item, $transformer, $this->entityType); $data = $this->createItem($item, $transformer, $this->entityType);
@ -161,7 +160,7 @@ class BaseAPIController extends Controller
} }
if (is_a($query, "Illuminate\Database\Eloquent\Builder")) { if (is_a($query, "Illuminate\Database\Eloquent\Builder")) {
$limit = Input::get('per_page', DEFAULT_API_PAGE_SIZE); $limit = \Request::input('per_page', DEFAULT_API_PAGE_SIZE);
if (Utils::isNinja()) { if (Utils::isNinja()) {
$limit = min(MAX_API_PAGE_SIZE, $limit); $limit = min(MAX_API_PAGE_SIZE, $limit);
} }
@ -178,7 +177,7 @@ class BaseAPIController extends Controller
protected function response($response) protected function response($response)
{ {
$index = Request::get('index') ?: 'data'; $index = \Request::get('index') ?: 'data';
if ($index == 'none') { if ($index == 'none') {
unset($response['meta']); unset($response['meta']);

View File

@ -3,7 +3,6 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Auth; use Auth;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use URL; use URL;
@ -15,24 +14,24 @@ class BlueVineController extends BaseController
$user = Auth::user(); $user = Auth::user();
$data = [ $data = [
'personal_user_full_name' => Input::get('name'), 'personal_user_full_name' => \Request::input('name'),
'business_phone_number' => Input::get('phone'), 'business_phone_number' => \Request::input('phone'),
'email' => Input::get('email'), 'email' => \Request::input('email'),
'personal_fico_score' => intval(Input::get('fico_score')), 'personal_fico_score' => intval(\Request::input('fico_score')),
'business_annual_revenue' => intval(Input::get('annual_revenue')), 'business_annual_revenue' => intval(\Request::input('annual_revenue')),
'business_monthly_average_bank_balance' => intval(Input::get('average_bank_balance')), 'business_monthly_average_bank_balance' => intval(\Request::input('average_bank_balance')),
'business_inception_date' => date('Y-m-d', strtotime(Input::get('business_inception'))), 'business_inception_date' => date('Y-m-d', strtotime(\Request::input('business_inception'))),
'partner_internal_business_id' => 'ninja_account_' . $user->account_id, 'partner_internal_business_id' => 'ninja_account_' . $user->account_id,
]; ];
if (! empty(Input::get('quote_type_factoring'))) { if (! empty(\Request::input('quote_type_factoring'))) {
$data['invoice_factoring_offer'] = true; $data['invoice_factoring_offer'] = true;
$data['desired_credit_line'] = intval(Input::get('desired_credit_limit')['invoice_factoring']); $data['desired_credit_line'] = intval(\Request::input('desired_credit_limit')['invoice_factoring']);
} }
if (! empty(Input::get('quote_type_loc'))) { if (! empty(\Request::input('quote_type_loc'))) {
$data['line_of_credit_offer'] = true; $data['line_of_credit_offer'] = true;
$data['desired_credit_line_for_loc'] = intval(Input::get('desired_credit_limit')['line_of_credit']); $data['desired_credit_line_for_loc'] = intval(\Request::input('desired_credit_limit')['line_of_credit']);
} }
$api_client = new \GuzzleHttp\Client(); $api_client = new \GuzzleHttp\Client();

View File

@ -12,7 +12,6 @@ use Auth;
use Cache; use Cache;
use DB; use DB;
use Exception; use Exception;
use Input;
use Utils; use Utils;
class BotController extends Controller class BotController extends Controller
@ -28,7 +27,7 @@ class BotController extends Controller
{ {
abort(404); abort(404);
$input = Input::all(); $input = \Request::all();
$botUserId = $input['from']['id']; $botUserId = $input['from']['id'];
if (! $token = $this->authenticate($input)) { if (! $token = $this->authenticate($input)) {

View File

@ -7,7 +7,6 @@ use App\Http\Requests\CreateClientRequest;
use App\Http\Requests\UpdateClientRequest; use App\Http\Requests\UpdateClientRequest;
use App\Models\Client; use App\Models\Client;
use App\Ninja\Repositories\ClientRepository; use App\Ninja\Repositories\ClientRepository;
use Input;
use Response; use Response;
class ClientApiController extends BaseAPIController class ClientApiController extends BaseAPIController
@ -46,11 +45,11 @@ class ClientApiController extends BaseAPIController
->orderBy('updated_at', 'desc') ->orderBy('updated_at', 'desc')
->withTrashed(); ->withTrashed();
if ($email = Input::get('email')) { if ($email = \Request::input('email')) {
$clients = $clients->whereHas('contacts', function ($query) use ($email) { $clients = $clients->whereHas('contacts', function ($query) use ($email) {
$query->where('email', $email); $query->where('email', $email);
}); });
} elseif ($idNumber = Input::get('id_number')) { } elseif ($idNumber = \Request::input('id_number')) {
$clients = $clients->whereIdNumber($idNumber); $clients = $clients->whereIdNumber($idNumber);
} }

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\ClientAuth; namespace App\Http\Controllers\ClientAuth;
use Illuminate\Mail\Message;
use Password; use Password;
use Config; use Config;
use Utils; use Utils;
@ -39,7 +40,7 @@ class ForgotPasswordController extends Controller
} }
/** /**
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
*/ */
public function showLinkRequestForm() public function showLinkRequestForm()
{ {
@ -55,7 +56,7 @@ class ForgotPasswordController extends Controller
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse|\Illuminate\Http\Response
*/ */
public function sendResetLinkEmail(Request $request) public function sendResetLinkEmail(Request $request)
{ {
@ -91,7 +92,7 @@ class ForgotPasswordController extends Controller
}); });
return $response == Password::RESET_LINK_SENT return $response == Password::RESET_LINK_SENT
? $this->sendResetLinkResponse($response) ? $this->sendResetLinkResponse($request, $response)
: $this->sendResetLinkFailedResponse($request, $response); : $this->sendResetLinkFailedResponse($request, $response);
} }

View File

@ -19,7 +19,6 @@ use App\Ninja\Repositories\ClientRepository;
use App\Services\ClientService; use App\Services\ClientService;
use Auth; use Auth;
use Cache; use Cache;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use URL; use URL;
@ -57,7 +56,7 @@ class ClientController extends BaseController
public function getDatatable() public function getDatatable()
{ {
$search = Input::get('sSearch'); $search = \Request::input('sSearch');
$userId = Auth::user()->filterIdByEntity(ENTITY_CLIENT); $userId = Auth::user()->filterIdByEntity(ENTITY_CLIENT);
return $this->clientService->getDatatable($search, $userId); return $this->clientService->getDatatable($search, $userId);
@ -201,7 +200,7 @@ class ClientController extends BaseController
private static function getViewModel() private static function getViewModel()
{ {
return [ return [
'data' => Input::old('data'), 'data' => \Request::old('data'),
'account' => Auth::user()->account, 'account' => Auth::user()->account,
'sizes' => Cache::get('sizes'), 'sizes' => Cache::get('sizes'),
'customLabel1' => Auth::user()->account->customLabel('client1'), 'customLabel1' => Auth::user()->account->customLabel('client1'),
@ -227,8 +226,8 @@ class ClientController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
if ($action == 'purge' && ! auth()->user()->is_admin) { if ($action == 'purge' && ! auth()->user()->is_admin) {
return redirect('dashboard')->withError(trans('texts.not_authorized')); return redirect('dashboard')->withError(trans('texts.not_authorized'));

View File

@ -89,7 +89,7 @@ class ClientPortalController extends BaseController
]); ]);
} }
if (! Input::has('phantomjs') && ! session('silent:' . $client->id) && ! Session::has($invitation->invitation_key) if (! Request::has('phantomjs') && ! session('silent:' . $client->id) && ! Session::has($invitation->invitation_key)
&& (! Auth::check() || Auth::user()->account_id != $invoice->account_id)) { && (! Auth::check() || Auth::user()->account_id != $invoice->account_id)) {
if ($invoice->isType(INVOICE_TYPE_QUOTE)) { if ($invoice->isType(INVOICE_TYPE_QUOTE)) {
event(new QuoteInvitationWasViewed($invoice, $invitation)); event(new QuoteInvitationWasViewed($invoice, $invitation));
@ -147,7 +147,7 @@ class ClientPortalController extends BaseController
} }
} }
if (! Input::has('phantomjs')) { if (! Request::has('phantomjs')) {
if ($wepayGateway = $account->getGatewayConfig(GATEWAY_WEPAY)) { if ($wepayGateway = $account->getGatewayConfig(GATEWAY_WEPAY)) {
$data['enableWePayACH'] = $wepayGateway->getAchEnabled(); $data['enableWePayACH'] = $wepayGateway->getAchEnabled();
} }
@ -172,7 +172,7 @@ class ClientPortalController extends BaseController
'contact' => $contact, 'contact' => $contact,
'paymentTypes' => $paymentTypes, 'paymentTypes' => $paymentTypes,
'paymentURL' => $paymentURL, 'paymentURL' => $paymentURL,
'phantomjs' => Input::has('phantomjs'), 'phantomjs' => Request::has('phantomjs'),
'gatewayTypeId' => count($paymentTypes) == 1 ? $paymentTypes[0]['gatewayTypeId'] : false, 'gatewayTypeId' => count($paymentTypes) == 1 ? $paymentTypes[0]['gatewayTypeId'] : false,
]; ];
@ -239,7 +239,7 @@ class ClientPortalController extends BaseController
return RESULT_FAILURE; return RESULT_FAILURE;
} }
if ($signature = Input::get('signature')) { if ($signature = \Request::input('signature')) {
$invitation->signature_base64 = $signature; $invitation->signature_base64 = $signature;
$invitation->signature_date = date_create(); $invitation->signature_date = date_create();
$invitation->save(); $invitation->save();
@ -400,7 +400,7 @@ class ClientPortalController extends BaseController
return ''; return '';
} }
return $this->invoiceRepo->getClientDatatable($contact->id, ENTITY_INVOICE, Input::get('sSearch')); return $this->invoiceRepo->getClientDatatable($contact->id, ENTITY_INVOICE, \Request::input('sSearch'));
} }
public function recurringInvoiceDatatable() public function recurringInvoiceDatatable()
@ -443,7 +443,7 @@ class ClientPortalController extends BaseController
if (! $contact = $this->getContact()) { if (! $contact = $this->getContact()) {
return $this->returnError(); return $this->returnError();
} }
$payments = $this->paymentRepo->findForContact($contact->id, Input::get('sSearch')); $payments = $this->paymentRepo->findForContact($contact->id, \Request::input('sSearch'));
return Datatable::query($payments) return Datatable::query($payments)
->addColumn('invoice_number', function ($model) { ->addColumn('invoice_number', function ($model) {
@ -528,7 +528,7 @@ class ClientPortalController extends BaseController
return false; return false;
} }
return $this->invoiceRepo->getClientDatatable($contact->id, ENTITY_QUOTE, Input::get('sSearch')); return $this->invoiceRepo->getClientDatatable($contact->id, ENTITY_QUOTE, \Request::input('sSearch'));
} }
public function creditIndex() public function creditIndex()
@ -637,7 +637,7 @@ class ClientPortalController extends BaseController
return false; return false;
} }
return $this->documentRepo->getClientDatatable($contact->id, ENTITY_DOCUMENT, Input::get('sSearch')); return $this->documentRepo->getClientDatatable($contact->id, ENTITY_DOCUMENT, \Request::input('sSearch'));
} }
private function returnError($error = false) private function returnError($error = false)
@ -850,9 +850,9 @@ class ClientPortalController extends BaseController
public function verifyPaymentMethod() public function verifyPaymentMethod()
{ {
$publicId = Input::get('source_id'); $publicId = \Request::input('source_id');
$amount1 = Input::get('verification1'); $amount1 = \Request::input('verification1');
$amount2 = Input::get('verification2'); $amount2 = \Request::input('verification2');
if (! $contact = $this->getContact()) { if (! $contact = $this->getContact()) {
return $this->returnError(); return $this->returnError();
@ -906,14 +906,14 @@ class ClientPortalController extends BaseController
$client = $contact->client; $client = $contact->client;
$account = $client->account; $account = $client->account;
$validator = Validator::make(Input::all(), ['source' => 'required']); $validator = Validator::make(Request::all(), ['source' => 'required']);
if ($validator->fails()) { if ($validator->fails()) {
return Redirect::to($client->account->enable_client_portal_dashboard ? '/client/dashboard' : '/client/payment_methods/'); return Redirect::to($client->account->enable_client_portal_dashboard ? '/client/dashboard' : '/client/payment_methods/');
} }
$paymentDriver = $account->paymentDriver(false, GATEWAY_TYPE_TOKEN); $paymentDriver = $account->paymentDriver(false, GATEWAY_TYPE_TOKEN);
$paymentMethod = PaymentMethod::clientId($client->id) $paymentMethod = PaymentMethod::clientId($client->id)
->wherePublicId(Input::get('source')) ->wherePublicId(\Request::input('source'))
->firstOrFail(); ->firstOrFail();
$customer = $paymentDriver->customer($client->id); $customer = $paymentDriver->customer($client->id);
@ -945,14 +945,14 @@ class ClientPortalController extends BaseController
$client = $contact->client; $client = $contact->client;
$validator = Validator::make(Input::all(), ['public_id' => 'required']); $validator = Validator::make(Request::all(), ['public_id' => 'required']);
if ($validator->fails()) { if ($validator->fails()) {
return Redirect::to('client/invoices/recurring'); return Redirect::to('client/invoices/recurring');
} }
$publicId = Input::get('public_id'); $publicId = \Request::input('public_id');
$enable = Input::get('enable'); $enable = \Request::input('enable');
$invoice = $client->invoices()->where('public_id', intval($publicId))->first(); $invoice = $client->invoices()->where('public_id', intval($publicId))->first();
if ($invoice && $invoice->is_recurring && ($invoice->auto_bill == AUTO_BILL_OPT_IN || $invoice->auto_bill == AUTO_BILL_OPT_OUT)) { if ($invoice && $invoice->is_recurring && ($invoice->auto_bill == AUTO_BILL_OPT_IN || $invoice->auto_bill == AUTO_BILL_OPT_OUT)) {

View File

@ -7,7 +7,6 @@ use App\Http\Requests\CreateContactRequest;
use App\Http\Requests\UpdateContactRequest; use App\Http\Requests\UpdateContactRequest;
use App\Models\Contact; use App\Models\Contact;
use App\Ninja\Repositories\ContactRepository; use App\Ninja\Repositories\ContactRepository;
use Input;
use Response; use Response;
use Utils; use Utils;
use App\Services\ContactService; use App\Services\ContactService;

View File

@ -8,7 +8,6 @@ use App\Http\Requests\UpdateCreditRequest;
use App\Models\Invoice; use App\Models\Invoice;
use App\Models\Credit; use App\Models\Credit;
use App\Ninja\Repositories\CreditRepository; use App\Ninja\Repositories\CreditRepository;
use Input;
use Response; use Response;
class CreditApiController extends BaseAPIController class CreditApiController extends BaseAPIController

View File

@ -10,7 +10,6 @@ use App\Models\Credit;
use App\Ninja\Datatables\CreditDatatable; use App\Ninja\Datatables\CreditDatatable;
use App\Ninja\Repositories\CreditRepository; use App\Ninja\Repositories\CreditRepository;
use App\Services\CreditService; use App\Services\CreditService;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use URL; use URL;
@ -47,13 +46,13 @@ class CreditController extends BaseController
public function getDatatable($clientPublicId = null) public function getDatatable($clientPublicId = null)
{ {
return $this->creditService->getDatatable($clientPublicId, Input::get('sSearch')); return $this->creditService->getDatatable($clientPublicId, \Request::input('sSearch'));
} }
public function create(CreditRequest $request) public function create(CreditRequest $request)
{ {
$data = [ $data = [
'clientPublicId' => Input::old('client') ? Input::old('client') : ($request->client_id ?: 0), 'clientPublicId' => \Request::old('client') ? \Request::old('client') : ($request->client_id ?: 0),
'credit' => null, 'credit' => null,
'method' => 'POST', 'method' => 'POST',
'url' => 'credits', 'url' => 'credits',
@ -111,7 +110,7 @@ class CreditController extends BaseController
private function save($credit = null) private function save($credit = null)
{ {
$credit = $this->creditService->save(Input::all(), $credit); $credit = $this->creditService->save(\Request::all(), $credit);
$message = $credit->wasRecentlyCreated ? trans('texts.created_credit') : trans('texts.updated_credit'); $message = $credit->wasRecentlyCreated ? trans('texts.created_credit') : trans('texts.updated_credit');
Session::flash('message', $message); Session::flash('message', $message);
@ -121,8 +120,8 @@ class CreditController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
$count = $this->creditService->bulk($ids, $action); $count = $this->creditService->bulk($ids, $action);
if ($count > 0) { if ($count > 0) {

View File

@ -8,7 +8,6 @@ use App\Http\Requests\UpdateExpenseCategoryRequest;
use App\Models\ExpenseCategory; use App\Models\ExpenseCategory;
use App\Ninja\Repositories\ExpenseCategoryRepository; use App\Ninja\Repositories\ExpenseCategoryRepository;
use App\Services\ExpenseCategoryService; use App\Services\ExpenseCategoryService;
use Input;
class ExpenseCategoryApiController extends BaseAPIController class ExpenseCategoryApiController extends BaseAPIController
{ {

View File

@ -8,7 +8,6 @@ use App\Http\Requests\UpdateExpenseCategoryRequest;
use App\Ninja\Datatables\ExpenseCategoryDatatable; use App\Ninja\Datatables\ExpenseCategoryDatatable;
use App\Ninja\Repositories\ExpenseCategoryRepository; use App\Ninja\Repositories\ExpenseCategoryRepository;
use App\Services\ExpenseCategoryService; use App\Services\ExpenseCategoryService;
use Input;
use Session; use Session;
use View; use View;
@ -40,7 +39,7 @@ class ExpenseCategoryController extends BaseController
public function getDatatable($expensePublicId = null) public function getDatatable($expensePublicId = null)
{ {
return $this->categoryService->getDatatable(Input::get('sSearch')); return $this->categoryService->getDatatable(\Request::input('sSearch'));
} }
public function create(ExpenseCategoryRequest $request) public function create(ExpenseCategoryRequest $request)
@ -89,8 +88,8 @@ class ExpenseCategoryController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
$count = $this->categoryService->bulk($ids, $action); $count = $this->categoryService->bulk($ids, $action);
if ($count > 0) { if ($count > 0) {

View File

@ -16,7 +16,6 @@ use App\Ninja\Repositories\InvoiceRepository;
use App\Services\ExpenseService; use App\Services\ExpenseService;
use Auth; use Auth;
use Cache; use Cache;
use Input;
use Redirect; use Redirect;
use Request; use Request;
use Session; use Session;
@ -61,7 +60,7 @@ class ExpenseController extends BaseController
public function getDatatable($expensePublicId = null) public function getDatatable($expensePublicId = null)
{ {
return $this->expenseService->getDatatable(Input::get('sSearch')); return $this->expenseService->getDatatable(\Request::input('sSearch'));
} }
public function getDatatableVendor($vendorPublicId = null) public function getDatatableVendor($vendorPublicId = null)
@ -83,7 +82,7 @@ class ExpenseController extends BaseController
} }
$data = [ $data = [
'vendorPublicId' => Input::old('vendor') ? Input::old('vendor') : $request->vendor_id, 'vendorPublicId' => Request::old('vendor') ? Request::old('vendor') : $request->vendor_id,
'expense' => null, 'expense' => null,
'method' => 'POST', 'method' => 'POST',
'url' => 'expenses', 'url' => 'expenses',
@ -190,7 +189,7 @@ class ExpenseController extends BaseController
Session::flash('message', trans('texts.updated_expense')); Session::flash('message', trans('texts.updated_expense'));
$action = Input::get('action'); $action = \Request::input('action');
if (in_array($action, ['archive', 'delete', 'restore', 'invoice', 'add_to_invoice'])) { if (in_array($action, ['archive', 'delete', 'restore', 'invoice', 'add_to_invoice'])) {
return self::bulk(); return self::bulk();
} }
@ -227,8 +226,8 @@ class ExpenseController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
$referer = Request::server('HTTP_REFERER'); $referer = Request::server('HTTP_REFERER');
switch ($action) { switch ($action) {
@ -268,7 +267,7 @@ class ExpenseController extends BaseController
->with('expenseCurrencyId', $currencyId) ->with('expenseCurrencyId', $currencyId)
->with('expenses', $ids); ->with('expenses', $ids);
} else { } else {
$invoiceId = Input::get('invoice_id'); $invoiceId = \Request::input('invoice_id');
return Redirect::to("invoices/{$invoiceId}/edit") return Redirect::to("invoices/{$invoiceId}/edit")
->with('expenseCurrencyId', $currencyId) ->with('expenseCurrencyId', $currencyId)
@ -291,7 +290,7 @@ class ExpenseController extends BaseController
private static function getViewModel($expense = false) private static function getViewModel($expense = false)
{ {
return [ return [
'data' => Input::old('data'), 'data' => Request::old('data'),
'account' => Auth::user()->account, 'account' => Auth::user()->account,
'vendors' => Vendor::scope()->withActiveOrSelected($expense ? $expense->vendor_id : false)->with('vendor_contacts')->orderBy('name')->get(), 'vendors' => Vendor::scope()->withActiveOrSelected($expense ? $expense->vendor_id : false)->with('vendor_contacts')->orderBy('name')->get(),
'clients' => Client::scope()->withActiveOrSelected($expense ? $expense->client_id : false)->with('contacts')->orderBy('name')->get(), 'clients' => Client::scope()->withActiveOrSelected($expense ? $expense->client_id : false)->with('contacts')->orderBy('name')->get(),

View File

@ -6,7 +6,6 @@ use App\Libraries\Utils;
use App\Models\Account; use App\Models\Account;
use App\Ninja\Mailers\Mailer; use App\Ninja\Mailers\Mailer;
use Auth; use Auth;
use Input;
use Mail; use Mail;
use Redirect; use Redirect;
use Request; use Request;
@ -67,21 +66,21 @@ class HomeController extends BaseController
{ {
$url = 'https://invoicing.co'; $url = 'https://invoicing.co';
if (Input::has('rc')) { if (Request::has('rc')) {
$url = $url . '?rc=' . Input::get('rc'); $url = $url . '?rc=' . \Request::input('rc');
} }
return Redirect::to($url); return Redirect::to($url);
/* /*
// Track the referral/campaign code // Track the referral/campaign code
if (Input::has('rc')) { if (Request::has('rc')) {
session([SESSION_REFERRAL_CODE => Input::get('rc')]); session([SESSION_REFERRAL_CODE => \Request::input('rc')]);
} }
if (Auth::check()) { if (Auth::check()) {
$redirectTo = Input::get('redirect_to') ? SITE_URL . '/' . ltrim(Input::get('redirect_to'), '/') : 'invoices/create'; $redirectTo = \Request::input('redirect_to') ? SITE_URL . '/' . ltrim(\Request::input('redirect_to'), '/') : 'invoices/create';
return Redirect::to($redirectTo)->with('sign_up', Input::get('sign_up')); return Redirect::to($redirectTo)->with('sign_up', \Request::input('sign_up'));
} else { } else {
return View::make('public.invoice_now'); return View::make('public.invoice_now');
} }
@ -125,7 +124,7 @@ class HomeController extends BaseController
*/ */
public function logError() public function logError()
{ {
return Utils::logError(Input::get('error'), 'JavaScript'); return Utils::logError(\Request::input('error'), 'JavaScript');
} }
/** /**

View File

@ -6,7 +6,6 @@ use Illuminate\Http\Request;
use App\Services\ImportService; use App\Services\ImportService;
use App\Jobs\ImportData; use App\Jobs\ImportData;
use Exception; use Exception;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use Utils; use Utils;
@ -26,7 +25,7 @@ class ImportController extends BaseController
return redirect('/settings/' . ACCOUNT_IMPORT_EXPORT)->withError(trans('texts.confirm_account_to_import')); return redirect('/settings/' . ACCOUNT_IMPORT_EXPORT)->withError(trans('texts.confirm_account_to_import'));
} }
$source = Input::get('source'); $source = \Request::input('source');
$files = []; $files = [];
$timestamp = time(); $timestamp = time();
@ -70,8 +69,8 @@ class ImportController extends BaseController
'timestamp' => $timestamp, 'timestamp' => $timestamp,
]); ]);
} elseif ($source === IMPORT_JSON) { } elseif ($source === IMPORT_JSON) {
$includeData = filter_var(Input::get('data'), FILTER_VALIDATE_BOOLEAN); $includeData = filter_var(\Request::input('data'), FILTER_VALIDATE_BOOLEAN);
$includeSettings = filter_var(Input::get('settings'), FILTER_VALIDATE_BOOLEAN); $includeSettings = filter_var(\Request::input('settings'), FILTER_VALIDATE_BOOLEAN);
if (config('queue.default') === 'sync') { if (config('queue.default') === 'sync') {
$results = $this->importService->importJSON($files[IMPORT_JSON], $includeData, $includeSettings); $results = $this->importService->importJSON($files[IMPORT_JSON], $includeData, $includeSettings);
$message = $this->importService->presentResults($results, $includeSettings); $message = $this->importService->presentResults($results, $includeSettings);
@ -109,9 +108,9 @@ class ImportController extends BaseController
public function doImportCSV() public function doImportCSV()
{ {
try { try {
$map = Input::get('map'); $map = \Request::input('map');
$headers = Input::get('headers'); $headers = \Request::input('headers');
$timestamp = Input::get('timestamp'); $timestamp = \Request::input('timestamp');
if (config('queue.default') === 'sync') { if (config('queue.default') === 'sync') {
$results = $this->importService->importCSV($map, $headers, $timestamp); $results = $this->importService->importCSV($map, $headers, $timestamp);

View File

@ -4,7 +4,6 @@ namespace App\Http\Controllers;
use App\Models\Subscription; use App\Models\Subscription;
use Auth; use Auth;
use Input;
use Response; use Response;
use Utils; use Utils;
@ -18,7 +17,7 @@ class IntegrationController extends BaseAPIController
*/ */
public function subscribe() public function subscribe()
{ {
$eventId = Utils::lookupEventId(trim(Input::get('event'))); $eventId = Utils::lookupEventId(trim(\Request::input('event')));
if (! $eventId) { if (! $eventId) {
return Response::json('Event is invalid', 500); return Response::json('Event is invalid', 500);
@ -26,7 +25,7 @@ class IntegrationController extends BaseAPIController
$subscription = Subscription::createNew(); $subscription = Subscription::createNew();
$subscription->event_id = $eventId; $subscription->event_id = $eventId;
$subscription->target_url = trim(Input::get('target_url')); $subscription->target_url = trim(\Request::input('target_url'));
$subscription->save(); $subscription->save();
if (! $subscription->id) { if (! $subscription->id) {

View File

@ -17,7 +17,6 @@ use App\Ninja\Repositories\PaymentRepository;
use App\Services\InvoiceService; use App\Services\InvoiceService;
use App\Services\PaymentService; use App\Services\PaymentService;
use Auth; use Auth;
use Input;
use Response; use Response;
use Utils; use Utils;
use Validator; use Validator;
@ -64,12 +63,12 @@ class InvoiceApiController extends BaseAPIController
->orderBy('updated_at', 'desc'); ->orderBy('updated_at', 'desc');
// Filter by invoice number // Filter by invoice number
if ($invoiceNumber = Input::get('invoice_number')) { if ($invoiceNumber = \Request::input('invoice_number')) {
$invoices->whereInvoiceNumber($invoiceNumber); $invoices->whereInvoiceNumber($invoiceNumber);
} }
// Fllter by status // Fllter by status
if ($statusId = Input::get('status_id')) { if ($statusId = \Request::input('status_id')) {
$invoices->where('invoice_status_id', '>=', $statusId); $invoices->where('invoice_status_id', '>=', $statusId);
} }
@ -134,7 +133,7 @@ class InvoiceApiController extends BaseAPIController
*/ */
public function store(CreateInvoiceAPIRequest $request) public function store(CreateInvoiceAPIRequest $request)
{ {
$data = Input::all(); $data = \Request::all();
$error = null; $error = null;
if (isset($data['email'])) { if (isset($data['email'])) {

View File

@ -25,8 +25,8 @@ use App\Services\RecurringInvoiceService;
use Auth; use Auth;
use Cache; use Cache;
use DB; use DB;
use Input;
use Redirect; use Redirect;
use Request;
use Session; use Session;
use URL; use URL;
use Utils; use Utils;
@ -68,7 +68,7 @@ class InvoiceController extends BaseController
public function getDatatable($clientPublicId = null) public function getDatatable($clientPublicId = null)
{ {
$accountId = Auth::user()->account_id; $accountId = Auth::user()->account_id;
$search = Input::get('sSearch'); $search = \Request::input('sSearch');
return $this->invoiceService->getDatatable($accountId, $clientPublicId, ENTITY_INVOICE, $search); return $this->invoiceService->getDatatable($accountId, $clientPublicId, ENTITY_INVOICE, $search);
} }
@ -76,7 +76,7 @@ class InvoiceController extends BaseController
public function getRecurringDatatable($clientPublicId = null) public function getRecurringDatatable($clientPublicId = null)
{ {
$accountId = Auth::user()->account_id; $accountId = Auth::user()->account_id;
$search = Input::get('sSearch'); $search = \Request::input('sSearch');
return $this->recurringInvoiceService->getDatatable($accountId, $clientPublicId, ENTITY_RECURRING_INVOICE, $search); return $this->recurringInvoiceService->getDatatable($accountId, $clientPublicId, ENTITY_RECURRING_INVOICE, $search);
} }
@ -317,7 +317,7 @@ class InvoiceController extends BaseController
} }
return [ return [
'data' => Input::old('data'), 'data' => Request::old('data'),
'account' => Auth::user()->account->load('country'), 'account' => Auth::user()->account->load('country'),
'products' => Product::scope()->orderBy('product_key')->get(), 'products' => Product::scope()->orderBy('product_key')->get(),
'taxRateOptions' => $taxRateOptions, 'taxRateOptions' => $taxRateOptions,
@ -345,8 +345,8 @@ class InvoiceController extends BaseController
$data = $request->input(); $data = $request->input();
$data['documents'] = $request->file('documents'); $data['documents'] = $request->file('documents');
$action = Input::get('action'); $action = \Request::input('action');
$entityType = Input::get('entityType'); $entityType = \Request::input('entityType');
$invoice = $this->invoiceService->save($data); $invoice = $this->invoiceService->save($data);
$entityType = $invoice->getEntityType(); $entityType = $invoice->getEntityType();
@ -379,8 +379,8 @@ class InvoiceController extends BaseController
$data = $request->input(); $data = $request->input();
$data['documents'] = $request->file('documents'); $data['documents'] = $request->file('documents');
$action = Input::get('action'); $action = \Request::input('action');
$entityType = Input::get('entityType'); $entityType = \Request::input('entityType');
$invoice = $this->invoiceService->save($data, $request->entity()); $invoice = $this->invoiceService->save($data, $request->entity());
$entityType = $invoice->getEntityType(); $entityType = $invoice->getEntityType();
@ -402,14 +402,14 @@ class InvoiceController extends BaseController
private function emailInvoice($invoice) private function emailInvoice($invoice)
{ {
$reminder = Input::get('reminder'); $reminder = \Request::input('reminder');
$template = Input::get('template'); $template = \Request::input('template');
$pdfUpload = Utils::decodePDF(Input::get('pdfupload')); $pdfUpload = Utils::decodePDF(\Request::input('pdfupload'));
$entityType = $invoice->getEntityType(); $entityType = $invoice->getEntityType();
if (filter_var(Input::get('save_as_default'), FILTER_VALIDATE_BOOLEAN)) { if (filter_var(\Request::input('save_as_default'), FILTER_VALIDATE_BOOLEAN)) {
$account = Auth::user()->account; $account = Auth::user()->account;
$account->setTemplateDefaults(Input::get('template_type'), $template['subject'], $template['body']); $account->setTemplateDefaults(\Request::input('template_type'), $template['subject'], $template['body']);
} }
if (! Auth::user()->confirmed) { if (! Auth::user()->confirmed) {
@ -490,8 +490,8 @@ class InvoiceController extends BaseController
*/ */
public function bulk($entityType = ENTITY_INVOICE) public function bulk($entityType = ENTITY_INVOICE)
{ {
$action = Input::get('bulk_action') ?: Input::get('action'); $action = \Request::input('bulk_action') ?: \Request::input('action');
$ids = Input::get('bulk_public_id') ?: (Input::get('public_id') ?: Input::get('ids')); $ids = \Request::input('bulk_public_id') ?: (\Request::input('public_id') ?: \Request::input('ids'));
$count = $this->invoiceService->bulk($ids, $action); $count = $this->invoiceService->bulk($ids, $action);
if ($count > 0) { if ($count > 0) {

View File

@ -11,13 +11,13 @@ use App\Libraries\CurlUtils;
use Auth; use Auth;
use Cache; use Cache;
use CreditCard; use CreditCard;
use Input;
use Omnipay; use Omnipay;
use Session; use Session;
use URL; use URL;
use Utils; use Utils;
use Validator; use Validator;
use View; use View;
use Request;
class NinjaController extends BaseController class NinjaController extends BaseController
{ {
@ -91,18 +91,18 @@ class NinjaController extends BaseController
*/ */
public function show_license_payment() public function show_license_payment()
{ {
if (Input::has('return_url')) { if (\Request::has('return_url')) {
session(['return_url' => Input::get('return_url')]); session(['return_url' => \Request::input('return_url')]);
} }
if (Input::has('affiliate_key')) { if (\Request::has('affiliate_key')) {
if ($affiliate = Affiliate::where('affiliate_key', '=', Input::get('affiliate_key'))->first()) { if ($affiliate = Affiliate::where('affiliate_key', '=', \Request::input('affiliate_key'))->first()) {
session(['affiliate_id' => $affiliate->id]); session(['affiliate_id' => $affiliate->id]);
} }
} }
if (Input::has('product_id')) { if (\Request::has('product_id')) {
session(['product_id' => Input::get('product_id')]); session(['product_id' => \Request::input('product_id')]);
} elseif (! Session::has('product_id')) { } elseif (! Session::has('product_id')) {
session(['product_id' => PRODUCT_ONE_CLICK_INSTALL]); session(['product_id' => PRODUCT_ONE_CLICK_INSTALL]);
} }
@ -111,8 +111,8 @@ class NinjaController extends BaseController
return Utils::fatalError(); return Utils::fatalError();
} }
if (Utils::isNinjaDev() && Input::has('test_mode')) { if (Utils::isNinjaDev() && \Request::has('test_mode')) {
session(['test_mode' => Input::get('test_mode')]); session(['test_mode' => \Request::input('test_mode')]);
} }
$account = $this->accountRepo->getNinjaAccount(); $account = $this->accountRepo->getNinjaAccount();
@ -167,7 +167,7 @@ class NinjaController extends BaseController
'country_id' => 'required', 'country_id' => 'required',
]; ];
$validator = Validator::make(Input::all(), $rules); $validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) { if ($validator->fails()) {
return redirect()->to('license') return redirect()->to('license')
@ -185,7 +185,7 @@ class NinjaController extends BaseController
if ($testMode) { if ($testMode) {
$ref = 'TEST_MODE'; $ref = 'TEST_MODE';
} else { } else {
$details = self::getLicensePaymentDetails(Input::all(), $affiliate); $details = self::getLicensePaymentDetails(Request::all(), $affiliate);
$gateway = Omnipay::create($accountGateway->gateway->provider); $gateway = Omnipay::create($accountGateway->gateway->provider);
$gateway->initialize((array) $accountGateway->getConfig()); $gateway->initialize((array) $accountGateway->getConfig());
@ -203,9 +203,9 @@ class NinjaController extends BaseController
$licenseKey = Utils::generateLicense(); $licenseKey = Utils::generateLicense();
$license = new License(); $license = new License();
$license->first_name = Input::get('first_name'); $license->first_name = \Request::input('first_name');
$license->last_name = Input::get('last_name'); $license->last_name = \Request::input('last_name');
$license->email = Input::get('email'); $license->email = \Request::input('email');
$license->transaction_reference = $ref; $license->transaction_reference = $ref;
$license->license_key = $licenseKey; $license->license_key = $licenseKey;
$license->affiliate_id = Session::get('affiliate_id'); $license->affiliate_id = Session::get('affiliate_id');
@ -241,8 +241,8 @@ class NinjaController extends BaseController
*/ */
public function claim_license() public function claim_license()
{ {
$licenseKey = Input::get('license_key'); $licenseKey = \Request::input('license_key');
$productId = Input::get('product_id', PRODUCT_ONE_CLICK_INSTALL); $productId = \Request::input('product_id', PRODUCT_ONE_CLICK_INSTALL);
// add in dashes // add in dashes
if (strlen($licenseKey) == 20) { if (strlen($licenseKey) == 20) {

View File

@ -19,12 +19,12 @@ use App\Services\PaymentService;
use Auth; use Auth;
use Crawler; use Crawler;
use Exception; use Exception;
use Input;
use Session; use Session;
use URL; use URL;
use Utils; use Utils;
use Validator; use Validator;
use View; use View;
use Request;
/** /**
* Class OnlinePaymentController. * Class OnlinePaymentController.
@ -114,7 +114,7 @@ class OnlinePaymentController extends BaseController
} }
try { try {
return $paymentDriver->startPurchase(Input::all(), $sourceId); return $paymentDriver->startPurchase(Request::all(), $sourceId);
} catch (Exception $exception) { } catch (Exception $exception) {
return $this->error($paymentDriver, $exception); return $this->error($paymentDriver, $exception);
} }
@ -202,12 +202,12 @@ class OnlinePaymentController extends BaseController
$paymentDriver = $invitation->account->paymentDriver($invitation, $gatewayTypeId); $paymentDriver = $invitation->account->paymentDriver($invitation, $gatewayTypeId);
if ($error = Input::get('error_description') ?: Input::get('error')) { if ($error = \Request::input('error_description') ?: \Request::input('error')) {
return $this->error($paymentDriver, $error); return $this->error($paymentDriver, $error);
} }
try { try {
if ($paymentDriver->completeOffsitePurchase(Input::all())) { if ($paymentDriver->completeOffsitePurchase(Request::all())) {
Session::flash('message', trans('texts.applied_payment')); Session::flash('message', trans('texts.applied_payment'));
} }
@ -332,7 +332,7 @@ class OnlinePaymentController extends BaseController
$paymentDriver = $accountGateway->paymentDriver(); $paymentDriver = $accountGateway->paymentDriver();
try { try {
$result = $paymentDriver->handleWebHook(Input::all()); $result = $paymentDriver->handleWebHook(Request::all());
return response()->json(['message' => $result]); return response()->json(['message' => $result]);
} catch (Exception $exception) { } catch (Exception $exception) {
@ -350,8 +350,8 @@ class OnlinePaymentController extends BaseController
return redirect()->to(NINJA_WEB_URL, 301); return redirect()->to(NINJA_WEB_URL, 301);
} }
$account = Account::whereAccountKey(Input::get('account_key'))->first(); $account = Account::whereAccountKey(\Request::input('account_key'))->first();
$redirectUrl = Input::get('redirect_url'); $redirectUrl = \Request::input('redirect_url');
$failureUrl = URL::previous(); $failureUrl = URL::previous();
if (! $account || ! $account->enable_buy_now_buttons || ! $account->hasFeature(FEATURE_BUY_NOW_BUTTONS)) { if (! $account || ! $account->enable_buy_now_buttons || ! $account->hasFeature(FEATURE_BUY_NOW_BUTTONS)) {
@ -360,7 +360,7 @@ class OnlinePaymentController extends BaseController
Auth::onceUsingId($account->users[0]->id); Auth::onceUsingId($account->users[0]->id);
$account->loadLocalizationSettings(); $account->loadLocalizationSettings();
$product = Product::scope(Input::get('product_id'))->first(); $product = Product::scope(\Request::input('product_id'))->first();
if (! $product) { if (! $product) {
return redirect()->to("{$failureUrl}/?error=invalid product"); return redirect()->to("{$failureUrl}/?error=invalid product");
@ -368,7 +368,7 @@ class OnlinePaymentController extends BaseController
// check for existing client using contact_key // check for existing client using contact_key
$client = false; $client = false;
if ($contactKey = Input::get('contact_key')) { if ($contactKey = \Request::input('contact_key')) {
$client = Client::scope()->whereHas('contacts', function ($query) use ($contactKey) { $client = Client::scope()->whereHas('contacts', function ($query) use ($contactKey) {
$query->where('contact_key', $contactKey); $query->where('contact_key', $contactKey);
})->first(); })->first();
@ -380,7 +380,7 @@ class OnlinePaymentController extends BaseController
'email' => 'email|string|max:100', 'email' => 'email|string|max:100',
]; ];
$validator = Validator::make(Input::all(), $rules); $validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) { if ($validator->fails()) {
return redirect()->to("{$failureUrl}/?error=" . $validator->errors()->first()); return redirect()->to("{$failureUrl}/?error=" . $validator->errors()->first());
} }
@ -404,17 +404,17 @@ class OnlinePaymentController extends BaseController
$data = [ $data = [
'client_id' => $client->id, 'client_id' => $client->id,
'is_recurring' => filter_var(Input::get('is_recurring'), FILTER_VALIDATE_BOOLEAN), 'is_recurring' => filter_var(\Request::input('is_recurring'), FILTER_VALIDATE_BOOLEAN),
'is_public' => filter_var(Input::get('is_recurring'), FILTER_VALIDATE_BOOLEAN), 'is_public' => filter_var(\Request::input('is_recurring'), FILTER_VALIDATE_BOOLEAN),
'frequency_id' => Input::get('frequency_id'), 'frequency_id' => \Request::input('frequency_id'),
'auto_bill_id' => Input::get('auto_bill_id'), 'auto_bill_id' => \Request::input('auto_bill_id'),
'start_date' => Input::get('start_date', date('Y-m-d')), 'start_date' => \Request::input('start_date', date('Y-m-d')),
'tax_rate1' => $account->tax_rate1, 'tax_rate1' => $account->tax_rate1,
'tax_name1' => $account->tax_name1 ?: '', 'tax_name1' => $account->tax_name1 ?: '',
'tax_rate2' => $account->tax_rate2, 'tax_rate2' => $account->tax_rate2,
'tax_name2' => $account->tax_name2 ?: '', 'tax_name2' => $account->tax_name2 ?: '',
'custom_text_value1' => Input::get('custom_invoice1'), 'custom_text_value1' => \Request::input('custom_invoice1'),
'custom_text_value2' => Input::get('custom_invoice2'), 'custom_text_value2' => \Request::input('custom_invoice2'),
'invoice_items' => [[ 'invoice_items' => [[
'product_key' => $product->product_key, 'product_key' => $product->product_key,
'notes' => $product->notes, 'notes' => $product->notes,
@ -424,8 +424,8 @@ class OnlinePaymentController extends BaseController
'tax_name1' => $product->tax_name1 ?: '', 'tax_name1' => $product->tax_name1 ?: '',
'tax_rate2' => $product->tax_rate2, 'tax_rate2' => $product->tax_rate2,
'tax_name2' => $product->tax_name2 ?: '', 'tax_name2' => $product->tax_name2 ?: '',
'custom_value1' => Input::get('custom_product1') ?: $product->custom_value1, 'custom_value1' => \Request::input('custom_product1') ?: $product->custom_value1,
'custom_value2' => Input::get('custom_product2') ?: $product->custom_value2, 'custom_value2' => \Request::input('custom_product2') ?: $product->custom_value2,
]], ]],
]; ];
$invoice = $invoiceService->save($data); $invoice = $invoiceService->save($data);
@ -445,7 +445,7 @@ class OnlinePaymentController extends BaseController
$link = $invitation->getLink(); $link = $invitation->getLink();
} }
if (filter_var(Input::get('return_link'), FILTER_VALIDATE_BOOLEAN)) { if (filter_var(\Request::input('return_link'), FILTER_VALIDATE_BOOLEAN)) {
return $link; return $link;
} else { } else {
return redirect()->to($link); return redirect()->to($link);

View File

@ -10,7 +10,6 @@ use App\Models\Payment;
use App\Ninja\Mailers\ContactMailer; use App\Ninja\Mailers\ContactMailer;
use App\Ninja\Repositories\PaymentRepository; use App\Ninja\Repositories\PaymentRepository;
use App\Services\PaymentService; use App\Services\PaymentService;
use Input;
use Response; use Response;
class PaymentApiController extends BaseAPIController class PaymentApiController extends BaseAPIController
@ -113,7 +112,7 @@ class PaymentApiController extends BaseAPIController
$payment = $this->paymentService->save($request->input(), null, $request->invoice); $payment = $this->paymentService->save($request->input(), null, $request->invoice);
if (Input::get('email_receipt')) { if (\Request::input('email_receipt')) {
$this->contactMailer->sendPaymentConfirmation($payment); $this->contactMailer->sendPaymentConfirmation($payment);
} }
@ -160,7 +159,7 @@ class PaymentApiController extends BaseAPIController
$data['public_id'] = $publicId; $data['public_id'] = $publicId;
$payment = $this->paymentRepo->save($data, $request->entity()); $payment = $this->paymentRepo->save($data, $request->entity());
if (Input::get('email_receipt')) { if (\Request::input('email_receipt')) {
$this->contactMailer->sendPaymentConfirmation($payment); $this->contactMailer->sendPaymentConfirmation($payment);
} }

View File

@ -16,10 +16,10 @@ use App\Services\PaymentService;
use Auth; use Auth;
use Cache; use Cache;
use DropdownButton; use DropdownButton;
use Input;
use Session; use Session;
use Utils; use Utils;
use View; use View;
use Request;
class PaymentController extends BaseController class PaymentController extends BaseController
{ {
@ -79,7 +79,7 @@ class PaymentController extends BaseController
*/ */
public function getDatatable($clientPublicId = null) public function getDatatable($clientPublicId = null)
{ {
return $this->paymentService->getDatatable($clientPublicId, Input::get('sSearch')); return $this->paymentService->getDatatable($clientPublicId, \Request::input('sSearch'));
} }
/** /**
@ -98,8 +98,8 @@ class PaymentController extends BaseController
->with('client', 'invoice_status') ->with('client', 'invoice_status')
->orderBy('invoice_number')->get(); ->orderBy('invoice_number')->get();
$clientPublicId = Input::old('client') ? Input::old('client') : ($request->client_id ?: 0); $clientPublicId = Request::old('client') ? Request::old('client') : ($request->client_id ?: 0);
$invoicePublicId = Input::old('invoice') ? Input::old('invoice') : ($request->invoice_id ?: 0); $invoicePublicId = Request::old('invoice') ? Request::old('invoice') : ($request->invoice_id ?: 0);
$totalCredit = false; $totalCredit = false;
if ($clientPublicId && $client = Client::scope($clientPublicId)->first()) { if ($clientPublicId && $client = Client::scope($clientPublicId)->first()) {
@ -118,7 +118,7 @@ class PaymentController extends BaseController
'method' => 'POST', 'method' => 'POST',
'url' => 'payments', 'url' => 'payments',
'title' => trans('texts.new_payment'), 'title' => trans('texts.new_payment'),
'paymentTypeId' => Input::get('paymentTypeId'), 'paymentTypeId' => \Request::input('paymentTypeId'),
'clients' => Client::scope()->with('contacts')->orderBy('name')->get(), 'clients' => Client::scope()->with('contacts')->orderBy('name')->get(),
'totalCredit' => $totalCredit, 'totalCredit' => $totalCredit,
]; ];
@ -211,7 +211,7 @@ class PaymentController extends BaseController
$payment = $this->paymentService->save($input, null, $request->invoice); $payment = $this->paymentService->save($input, null, $request->invoice);
if (Input::get('email_receipt')) { if (\Request::input('email_receipt')) {
$this->contactMailer->sendPaymentConfirmation($payment); $this->contactMailer->sendPaymentConfirmation($payment);
Session::flash('message', trans($credit ? 'texts.created_payment_and_credit_emailed_client' : 'texts.created_payment_emailed_client')); Session::flash('message', trans($credit ? 'texts.created_payment_and_credit_emailed_client' : 'texts.created_payment_emailed_client'));
} else { } else {
@ -244,8 +244,8 @@ class PaymentController extends BaseController
*/ */
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
if ($action === 'email') { if ($action === 'email') {
$payment = Payment::scope($ids)->withArchived()->first(); $payment = Payment::scope($ids)->withArchived()->first();
@ -253,8 +253,8 @@ class PaymentController extends BaseController
Session::flash('message', trans('texts.emailed_payment')); Session::flash('message', trans('texts.emailed_payment'));
} else { } else {
$count = $this->paymentService->bulk($ids, $action, [ $count = $this->paymentService->bulk($ids, $action, [
'refund_amount' => Input::get('refund_amount'), 'refund_amount' => \Request::input('refund_amount'),
'refund_email' => Input::get('refund_email'), 'refund_email' => \Request::input('refund_email'),
]); ]);
if ($count > 0) { if ($count > 0) {
$message = Utils::pluralize($action == 'refund' ? 'refunded_payment' : $action.'d_payment', $count); $message = Utils::pluralize($action == 'refund' ? 'refunded_payment' : $action.'d_payment', $count);

View File

@ -115,7 +115,7 @@ class PaymentTermApiController extends BaseAPIController
$paymentTerm = PaymentTerm::createNew(); $paymentTerm = PaymentTerm::createNew();
$paymentTerm->num_days = Utils::parseInt(Input::get('num_days')); $paymentTerm->num_days = Utils::parseInt(\Request::input('num_days'));
$paymentTerm->name = 'Net ' . $paymentTerm->num_days; $paymentTerm->name = 'Net ' . $paymentTerm->num_days;
$paymentTerm->save(); $paymentTerm->save();

View File

@ -7,7 +7,6 @@ use App\Http\Requests\UpdatePaymentTermRequest;
use App\Models\PaymentTerm; use App\Models\PaymentTerm;
use App\Services\PaymentTermService; use App\Services\PaymentTermService;
use Auth; use Auth;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use URL; use URL;
@ -114,7 +113,7 @@ class PaymentTermController extends BaseController
$paymentTerm = PaymentTerm::createNew(); $paymentTerm = PaymentTerm::createNew();
} }
$paymentTerm->num_days = Utils::parseInt(Input::get('num_days')); $paymentTerm->num_days = Utils::parseInt(\Request::input('num_days'));
$paymentTerm->name = 'Net ' . $paymentTerm->num_days; $paymentTerm->name = 'Net ' . $paymentTerm->num_days;
$paymentTerm->save(); $paymentTerm->save();
@ -129,8 +128,8 @@ class PaymentTermController extends BaseController
*/ */
public function bulk() public function bulk()
{ {
$action = Input::get('bulk_action'); $action = \Request::input('bulk_action');
$ids = Input::get('bulk_public_id'); $ids = \Request::input('bulk_public_id');
$count = $this->paymentTermService->bulk($ids, $action); $count = $this->paymentTermService->bulk($ids, $action);
Session::flash('message', trans('texts.archived_payment_term')); Session::flash('message', trans('texts.archived_payment_term'));

View File

@ -12,7 +12,6 @@ use App\Ninja\Repositories\ProductRepository;
use App\Services\ProductService; use App\Services\ProductService;
use Auth; use Auth;
use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Auth\Access\AuthorizationException;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use URL; use URL;
@ -72,7 +71,7 @@ class ProductController extends BaseController
*/ */
public function getDatatable() public function getDatatable()
{ {
return $this->productService->getDatatable(Auth::user()->account_id, Input::get('sSearch')); return $this->productService->getDatatable(Auth::user()->account_id, \Request::input('sSearch'));
} }
public function cloneProduct(ProductRequest $request, $publicId) public function cloneProduct(ProductRequest $request, $publicId)
@ -167,7 +166,7 @@ class ProductController extends BaseController
$product = Product::createNew(); $product = Product::createNew();
} }
$this->productRepo->save(Input::all(), $product); $this->productRepo->save(\Request::all(), $product);
$message = $productPublicId ? trans('texts.updated_product') : trans('texts.created_product'); $message = $productPublicId ? trans('texts.updated_product') : trans('texts.created_product');
Session::flash('message', $message); Session::flash('message', $message);
@ -189,8 +188,8 @@ class ProductController extends BaseController
*/ */
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
if ($action == 'invoice') { if ($action == 'invoice') {
$products = Product::scope($ids)->get(); $products = Product::scope($ids)->get();

View File

@ -9,7 +9,6 @@ use App\Models\Project;
use App\Ninja\Repositories\ProjectRepository; use App\Ninja\Repositories\ProjectRepository;
use App\Services\ProjectService; use App\Services\ProjectService;
use Auth; use Auth;
use Input;
use Session; use Session;
use View; use View;

View File

@ -12,7 +12,6 @@ use App\Ninja\Datatables\ProjectDatatable;
use App\Ninja\Repositories\ProjectRepository; use App\Ninja\Repositories\ProjectRepository;
use App\Services\ProjectService; use App\Services\ProjectService;
use Auth; use Auth;
use Input;
use Session; use Session;
use View; use View;
@ -44,7 +43,7 @@ class ProjectController extends BaseController
public function getDatatable($expensePublicId = null) public function getDatatable($expensePublicId = null)
{ {
$search = Input::get('sSearch'); $search = \Request::input('sSearch');
$userId = Auth::user()->filterIdByEntity(ENTITY_PROJECT); $userId = Auth::user()->filterIdByEntity(ENTITY_PROJECT);
return $this->projectService->getDatatable($search, $userId); return $this->projectService->getDatatable($search, $userId);
@ -114,7 +113,7 @@ class ProjectController extends BaseController
Session::flash('message', trans('texts.updated_project')); Session::flash('message', trans('texts.updated_project'));
$action = Input::get('action'); $action = \Request::input('action');
if (in_array($action, ['archive', 'delete', 'restore', 'invoice'])) { if (in_array($action, ['archive', 'delete', 'restore', 'invoice'])) {
return self::bulk(); return self::bulk();
} }
@ -124,8 +123,8 @@ class ProjectController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
if ($action == 'invoice') { if ($action == 'invoice') {
$data = []; $data = [];

View File

@ -11,7 +11,6 @@ use App\Ninja\Datatables\ProposalCategoryDatatable;
use App\Ninja\Repositories\ProposalCategoryRepository; use App\Ninja\Repositories\ProposalCategoryRepository;
use App\Services\ProposalCategoryService; use App\Services\ProposalCategoryService;
use Auth; use Auth;
use Input;
use Session; use Session;
use View; use View;
@ -43,7 +42,7 @@ class ProposalCategoryController extends BaseController
public function getDatatable($expensePublicId = null) public function getDatatable($expensePublicId = null)
{ {
$search = Input::get('sSearch'); $search = \Request::input('sSearch');
$userId = Auth::user()->filterId(); $userId = Auth::user()->filterId();
return $this->proposalCategoryService->getDatatable($search, $userId); return $this->proposalCategoryService->getDatatable($search, $userId);
@ -102,7 +101,7 @@ class ProposalCategoryController extends BaseController
Session::flash('message', trans('texts.updated_proposal_category')); Session::flash('message', trans('texts.updated_proposal_category'));
$action = Input::get('action'); $action = \Request::input('action');
if (in_array($action, ['archive', 'delete', 'restore'])) { if (in_array($action, ['archive', 'delete', 'restore'])) {
return self::bulk(); return self::bulk();
} }
@ -112,8 +111,8 @@ class ProposalCategoryController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
$count = $this->proposalCategoryService->bulk($ids, $action); $count = $this->proposalCategoryService->bulk($ids, $action);

View File

@ -15,7 +15,6 @@ use App\Ninja\Datatables\ProposalDatatable;
use App\Ninja\Repositories\ProposalRepository; use App\Ninja\Repositories\ProposalRepository;
use App\Services\ProposalService; use App\Services\ProposalService;
use Auth; use Auth;
use Input;
use Session; use Session;
use View; use View;
@ -50,7 +49,7 @@ class ProposalController extends BaseController
public function getDatatable($expensePublicId = null) public function getDatatable($expensePublicId = null)
{ {
$search = Input::get('sSearch'); $search = \Request::input('sSearch');
//$userId = Auth::user()->filterId(); //$userId = Auth::user()->filterId();
$userId = Auth::user()->filterIdByEntity(ENTITY_PROPOSAL); $userId = Auth::user()->filterIdByEntity(ENTITY_PROPOSAL);
@ -117,7 +116,7 @@ class ProposalController extends BaseController
public function store(CreateProposalRequest $request) public function store(CreateProposalRequest $request)
{ {
$proposal = $this->proposalService->save($request->input()); $proposal = $this->proposalService->save($request->input());
$action = Input::get('action'); $action = \Request::input('action');
if ($action == 'email') { if ($action == 'email') {
$this->dispatch(new SendInvoiceEmail($proposal->invoice, auth()->user()->id, false, false, $proposal)); $this->dispatch(new SendInvoiceEmail($proposal->invoice, auth()->user()->id, false, false, $proposal));
@ -132,7 +131,7 @@ class ProposalController extends BaseController
public function update(UpdateProposalRequest $request) public function update(UpdateProposalRequest $request)
{ {
$proposal = $this->proposalService->save($request->input(), $request->entity()); $proposal = $this->proposalService->save($request->input(), $request->entity());
$action = Input::get('action'); $action = \Request::input('action');
if (in_array($action, ['archive', 'delete', 'restore'])) { if (in_array($action, ['archive', 'delete', 'restore'])) {
return self::bulk(); return self::bulk();
@ -150,8 +149,8 @@ class ProposalController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('bulk_action') ?: Input::get('action'); $action = \Request::input('bulk_action') ?: \Request::input('action');
$ids = Input::get('bulk_public_id') ?: (Input::get('public_id') ?: Input::get('ids')); $ids = \Request::input('bulk_public_id') ?: (\Request::input('public_id') ?: \Request::input('ids'));
$count = $this->proposalService->bulk($ids, $action); $count = $this->proposalService->bulk($ids, $action);

View File

@ -12,7 +12,6 @@ use App\Ninja\Datatables\ProposalSnippetDatatable;
use App\Ninja\Repositories\ProposalSnippetRepository; use App\Ninja\Repositories\ProposalSnippetRepository;
use App\Services\ProposalSnippetService; use App\Services\ProposalSnippetService;
use Auth; use Auth;
use Input;
use Session; use Session;
use View; use View;
@ -44,7 +43,7 @@ class ProposalSnippetController extends BaseController
public function getDatatable($expensePublicId = null) public function getDatatable($expensePublicId = null)
{ {
$search = Input::get('sSearch'); $search = \Request::input('sSearch');
$userId = Auth::user()->filterId(); $userId = Auth::user()->filterId();
return $this->proposalSnippetService->getDatatable($search, $userId); return $this->proposalSnippetService->getDatatable($search, $userId);
@ -107,7 +106,7 @@ class ProposalSnippetController extends BaseController
Session::flash('message', trans('texts.updated_proposal_snippet')); Session::flash('message', trans('texts.updated_proposal_snippet'));
$action = Input::get('action'); $action = \Request::input('action');
if (in_array($action, ['archive', 'delete', 'restore'])) { if (in_array($action, ['archive', 'delete', 'restore'])) {
return self::bulk(); return self::bulk();
} }
@ -117,8 +116,8 @@ class ProposalSnippetController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
$count = $this->proposalSnippetService->bulk($ids, $action); $count = $this->proposalSnippetService->bulk($ids, $action);

View File

@ -11,7 +11,6 @@ use App\Ninja\Datatables\ProposalTemplateDatatable;
use App\Ninja\Repositories\ProposalTemplateRepository; use App\Ninja\Repositories\ProposalTemplateRepository;
use App\Services\ProposalTemplateService; use App\Services\ProposalTemplateService;
use Auth; use Auth;
use Input;
use Session; use Session;
use View; use View;
@ -43,7 +42,7 @@ class ProposalTemplateController extends BaseController
public function getDatatable($expensePublicId = null) public function getDatatable($expensePublicId = null)
{ {
$search = Input::get('sSearch'); $search = \Request::input('sSearch');
$userId = Auth::user()->filterId(); $userId = Auth::user()->filterId();
return $this->proposalTemplateService->getDatatable($search, $userId); return $this->proposalTemplateService->getDatatable($search, $userId);
@ -147,7 +146,7 @@ class ProposalTemplateController extends BaseController
Session::flash('message', trans('texts.updated_proposal_template')); Session::flash('message', trans('texts.updated_proposal_template'));
$action = Input::get('action'); $action = \Request::input('action');
if (in_array($action, ['archive', 'delete', 'restore'])) { if (in_array($action, ['archive', 'delete', 'restore'])) {
return self::bulk(); return self::bulk();
} }
@ -157,8 +156,8 @@ class ProposalTemplateController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
$count = $this->proposalTemplateService->bulk($ids, $action); $count = $this->proposalTemplateService->bulk($ids, $action);

View File

@ -19,7 +19,6 @@ use App\Ninja\Repositories\InvoiceRepository;
use App\Services\InvoiceService; use App\Services\InvoiceService;
use Auth; use Auth;
use Cache; use Cache;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use Utils; use Utils;
@ -60,7 +59,7 @@ class QuoteController extends BaseController
public function getDatatable($clientPublicId = null) public function getDatatable($clientPublicId = null)
{ {
$accountId = Auth::user()->account_id; $accountId = Auth::user()->account_id;
$search = Input::get('sSearch'); $search = \Request::input('sSearch');
return $this->invoiceService->getDatatable($accountId, $clientPublicId, ENTITY_QUOTE, $search); return $this->invoiceService->getDatatable($accountId, $clientPublicId, ENTITY_QUOTE, $search);
} }
@ -82,7 +81,7 @@ class QuoteController extends BaseController
$data = [ $data = [
'entityType' => $invoice->getEntityType(), 'entityType' => $invoice->getEntityType(),
'invoice' => $invoice, 'invoice' => $invoice,
'data' => Input::old('data'), 'data' => \Request::old('data'),
'method' => 'POST', 'method' => 'POST',
'url' => 'invoices', 'url' => 'invoices',
'title' => trans('texts.new_quote'), 'title' => trans('texts.new_quote'),
@ -115,9 +114,9 @@ class QuoteController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('bulk_action') ?: Input::get('action'); $action = \Request::input('bulk_action') ?: \Request::input('action');
; ;
$ids = Input::get('bulk_public_id') ?: (Input::get('public_id') ?: Input::get('ids')); $ids = \Request::input('bulk_public_id') ?: (\Request::input('public_id') ?: \Request::input('ids'));
if ($action == 'convert') { if ($action == 'convert') {
$invoice = Invoice::with('invoice_items')->scope($ids)->firstOrFail(); $invoice = Invoice::with('invoice_items')->scope($ids)->firstOrFail();

View File

@ -13,10 +13,10 @@ use App\Ninja\Datatables\RecurringExpenseDatatable;
use App\Ninja\Repositories\RecurringExpenseRepository; use App\Ninja\Repositories\RecurringExpenseRepository;
use App\Services\RecurringExpenseService; use App\Services\RecurringExpenseService;
use Auth; use Auth;
use Input;
use Session; use Session;
use View; use View;
use Cache; use Cache;
use Request;
class RecurringExpenseController extends BaseController class RecurringExpenseController extends BaseController
{ {
@ -46,7 +46,7 @@ class RecurringExpenseController extends BaseController
public function getDatatable($expensePublicId = null) public function getDatatable($expensePublicId = null)
{ {
$search = Input::get('sSearch'); $search = \Request::input('sSearch');
$userId = Auth::user()->filterId(); $userId = Auth::user()->filterId();
return $this->recurringExpenseService->getDatatable($search, $userId); return $this->recurringExpenseService->getDatatable($search, $userId);
@ -61,7 +61,7 @@ class RecurringExpenseController extends BaseController
} }
$data = [ $data = [
'vendorPublicId' => Input::old('vendor') ? Input::old('vendor') : $request->vendor_id, 'vendorPublicId' => Request::old('vendor') ? Request::old('vendor') : $request->vendor_id,
'expense' => null, 'expense' => null,
'method' => 'POST', 'method' => 'POST',
'url' => 'recurring_expenses', 'url' => 'recurring_expenses',
@ -113,7 +113,7 @@ class RecurringExpenseController extends BaseController
private static function getViewModel() private static function getViewModel()
{ {
return [ return [
'data' => Input::old('data'), 'data' => Request::old('data'),
'account' => Auth::user()->account, 'account' => Auth::user()->account,
'categories' => ExpenseCategory::whereAccountId(Auth::user()->account_id)->withArchived()->orderBy('name')->get(), 'categories' => ExpenseCategory::whereAccountId(Auth::user()->account_id)->withArchived()->orderBy('name')->get(),
'taxRates' => TaxRate::scope()->whereIsInclusive(false)->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->whereIsInclusive(false)->orderBy('name')->get(),
@ -136,7 +136,7 @@ class RecurringExpenseController extends BaseController
Session::flash('message', trans('texts.updated_recurring_expense')); Session::flash('message', trans('texts.updated_recurring_expense'));
if (in_array(Input::get('action'), ['archive', 'delete', 'restore'])) { if (in_array(\Request::input('action'), ['archive', 'delete', 'restore'])) {
return self::bulk(); return self::bulk();
} }
@ -145,8 +145,8 @@ class RecurringExpenseController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
$count = $this->recurringExpenseService->bulk($ids, $action); $count = $this->recurringExpenseService->bulk($ids, $action);
if ($count > 0) { if ($count > 0) {

View File

@ -8,7 +8,6 @@ use App\Jobs\RunReport;
use App\Models\Account; use App\Models\Account;
use App\Models\ScheduledReport; use App\Models\ScheduledReport;
use Auth; use Auth;
use Input;
use Utils; use Utils;
use View; use View;
use Carbon; use Carbon;
@ -58,14 +57,14 @@ class ReportController extends BaseController
return redirect('/'); return redirect('/');
} }
$action = Input::get('action'); $action = \Request::input('action');
$format = Input::get('format'); $format = \Request::input('format');
if (Input::get('report_type')) { if (\Request::input('report_type')) {
$reportType = Input::get('report_type'); $reportType = \Request::input('report_type');
$dateField = Input::get('date_field'); $dateField = \Request::input('date_field');
$startDate = date_create(Input::get('start_date')); $startDate = date_create(\Request::input('start_date'));
$endDate = date_create(Input::get('end_date')); $endDate = date_create(\Request::input('end_date'));
} else { } else {
$reportType = ENTITY_INVOICE; $reportType = ENTITY_INVOICE;
$dateField = FILTER_INVOICE_DATE; $dateField = FILTER_INVOICE_DATE;

View File

@ -5,7 +5,6 @@ namespace App\Http\Controllers;
use App\Models\Subscription; use App\Models\Subscription;
use App\Services\SubscriptionService; use App\Services\SubscriptionService;
use Auth; use Auth;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use URL; use URL;
@ -107,8 +106,8 @@ class SubscriptionController extends BaseController
*/ */
public function bulk() public function bulk()
{ {
$action = Input::get('bulk_action'); $action = \Request::input('bulk_action');
$ids = Input::get('bulk_public_id'); $ids = \Request::input('bulk_public_id');
$count = $this->subscriptionService->bulk($ids, $action); $count = $this->subscriptionService->bulk($ids, $action);
@ -137,7 +136,7 @@ class SubscriptionController extends BaseController
$subscriptionPublicId = $subscription->public_id; $subscriptionPublicId = $subscription->public_id;
} }
$validator = Validator::make(Input::all(), $rules); $validator = Validator::make(\Request::all(), $rules);
if ($validator->fails()) { if ($validator->fails()) {
return Redirect::to($subscriptionPublicId ? 'subscriptions/edit' : 'subscriptions/create')->withInput()->withErrors($validator); return Redirect::to($subscriptionPublicId ? 'subscriptions/edit' : 'subscriptions/create')->withInput()->withErrors($validator);

View File

@ -8,7 +8,6 @@ use App\Models\Task;
use App\Ninja\Repositories\TaskRepository; use App\Ninja\Repositories\TaskRepository;
use App\Ninja\Transformers\TaskTransformer; use App\Ninja\Transformers\TaskTransformer;
use Auth; use Auth;
use Input;
use Response; use Response;
class TaskApiController extends BaseAPIController class TaskApiController extends BaseAPIController
@ -103,7 +102,7 @@ class TaskApiController extends BaseAPIController
*/ */
public function store() public function store()
{ {
$data = Input::all(); $data = \Request::all();
$taskId = isset($data['id']) ? $data['id'] : false; $taskId = isset($data['id']) ? $data['id'] : false;
if (isset($data['client_id']) && $data['client_id']) { if (isset($data['client_id']) && $data['client_id']) {
@ -143,7 +142,7 @@ class TaskApiController extends BaseAPIController
$task = $this->taskRepo->save($taskId, $data); $task = $this->taskRepo->save($taskId, $data);
$task = Task::scope($task->public_id)->with('client')->first(); $task = Task::scope($task->public_id)->with('client')->first();
$transformer = new TaskTransformer(Auth::user()->account, Input::get('serializer')); $transformer = new TaskTransformer(Auth::user()->account, \Request::input('serializer'));
$data = $this->createItem($task, $transformer, 'task'); $data = $this->createItem($task, $transformer, 'task');
return $this->response($data); return $this->response($data);
@ -185,7 +184,7 @@ class TaskApiController extends BaseAPIController
$task = $request->entity(); $task = $request->entity();
$task = $this->taskRepo->save($task->public_id, \Illuminate\Support\Facades\Input::all()); $task = $this->taskRepo->save($task->public_id, \Illuminate\Support\Facades\Request::all());
return $this->itemResponse($task); return $this->itemResponse($task);
} }

View File

@ -15,7 +15,6 @@ use App\Ninja\Repositories\TaskRepository;
use App\Services\TaskService; use App\Services\TaskService;
use Auth; use Auth;
use DropdownButton; use DropdownButton;
use Input;
use Redirect; use Redirect;
use Request; use Request;
use Session; use Session;
@ -86,7 +85,7 @@ class TaskController extends BaseController
*/ */
public function getDatatable($clientPublicId = null, $projectPublicId = null) public function getDatatable($clientPublicId = null, $projectPublicId = null)
{ {
return $this->taskService->getDatatable($clientPublicId, $projectPublicId, Input::get('sSearch')); return $this->taskService->getDatatable($clientPublicId, $projectPublicId, \Request::input('sSearch'));
} }
/** /**
@ -126,8 +125,8 @@ class TaskController extends BaseController
$data = [ $data = [
'task' => null, 'task' => null,
'clientPublicId' => Input::old('client') ? Input::old('client') : ($request->client_id ?: 0), 'clientPublicId' => Request::old('client') ? Request::old('client') : ($request->client_id ?: 0),
'projectPublicId' => Input::old('project_id') ? Input::old('project_id') : ($request->project_id ?: 0), 'projectPublicId' => Request::old('project_id') ? Request::old('project_id') : ($request->project_id ?: 0),
'method' => 'POST', 'method' => 'POST',
'url' => 'tasks', 'url' => 'tasks',
'title' => trans('texts.new_task'), 'title' => trans('texts.new_task'),
@ -229,7 +228,7 @@ class TaskController extends BaseController
*/ */
private function save($request, $publicId = null) private function save($request, $publicId = null)
{ {
$action = Input::get('action'); $action = \Request::input('action');
if (in_array($action, ['archive', 'delete', 'restore'])) { if (in_array($action, ['archive', 'delete', 'restore'])) {
return self::bulk(); return self::bulk();
@ -260,8 +259,8 @@ class TaskController extends BaseController
*/ */
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ?: (Input::get('id') ?: Input::get('ids')); $ids = \Request::input('public_id') ?: (\Request::input('id') ?: \Request::input('ids'));
$referer = Request::server('HTTP_REFERER'); $referer = Request::server('HTTP_REFERER');
if (in_array($action, ['resume', 'stop'])) { if (in_array($action, ['resume', 'stop'])) {
@ -315,7 +314,7 @@ class TaskController extends BaseController
if ($action == 'invoice') { if ($action == 'invoice') {
return Redirect::to("invoices/create/{$clientPublicId}")->with('tasks', $data); return Redirect::to("invoices/create/{$clientPublicId}")->with('tasks', $data);
} else { } else {
$invoiceId = Input::get('invoice_id'); $invoiceId = \Request::input('invoice_id');
return Redirect::to("invoices/{$invoiceId}/edit")->with('tasks', $data); return Redirect::to("invoices/{$invoiceId}/edit")->with('tasks', $data);
} }

View File

@ -8,7 +8,6 @@ use App\Models\TaxRate;
use App\Ninja\Repositories\TaxRateRepository; use App\Ninja\Repositories\TaxRateRepository;
use App\Services\TaxRateService; use App\Services\TaxRateService;
use Auth; use Auth;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use URL; use URL;
@ -81,8 +80,8 @@ class TaxRateController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('bulk_action'); $action = \Request::input('bulk_action');
$ids = Input::get('bulk_public_id'); $ids = \Request::input('bulk_public_id');
$count = $this->taxRateService->bulk($ids, $action); $count = $this->taxRateService->bulk($ids, $action);
Session::flash('message', trans('texts.archived_tax_rate')); Session::flash('message', trans('texts.archived_tax_rate'));

View File

@ -5,7 +5,6 @@ namespace App\Http\Controllers;
use App\Models\AccountToken; use App\Models\AccountToken;
use App\Services\TokenService; use App\Services\TokenService;
use Auth; use Auth;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use URL; use URL;
@ -108,8 +107,8 @@ class TokenController extends BaseController
*/ */
public function bulk() public function bulk()
{ {
$action = Input::get('bulk_action'); $action = \Request::input('bulk_action');
$ids = Input::get('bulk_public_id'); $ids = \Request::input('bulk_public_id');
$count = $this->tokenService->bulk($ids, $action); $count = $this->tokenService->bulk($ids, $action);
Session::flash('message', trans('texts.archived_token')); Session::flash('message', trans('texts.archived_token'));
@ -134,17 +133,17 @@ class TokenController extends BaseController
->where('public_id', '=', $tokenPublicId)->firstOrFail(); ->where('public_id', '=', $tokenPublicId)->firstOrFail();
} }
$validator = Validator::make(Input::all(), $rules); $validator = Validator::make(\Request::all(), $rules);
if ($validator->fails()) { if ($validator->fails()) {
return Redirect::to($tokenPublicId ? 'tokens/edit' : 'tokens/create')->withInput()->withErrors($validator); return Redirect::to($tokenPublicId ? 'tokens/edit' : 'tokens/create')->withInput()->withErrors($validator);
} }
if ($tokenPublicId) { if ($tokenPublicId) {
$token->name = trim(Input::get('name')); $token->name = trim(\Request::input('name'));
} else { } else {
$token = AccountToken::createNew(); $token = AccountToken::createNew();
$token->name = trim(Input::get('name')); $token->name = trim(\Request::input('name'));
$token->token = strtolower(str_random(RANDOM_KEY_LENGTH)); $token->token = strtolower(str_random(RANDOM_KEY_LENGTH));
} }

View File

@ -8,7 +8,6 @@ use App\Ninja\Mailers\UserMailer;
use App\Ninja\Repositories\AccountRepository; use App\Ninja\Repositories\AccountRepository;
use App\Services\UserService; use App\Services\UserService;
use Auth; use Auth;
use Input;
use Password; use Password;
use Redirect; use Redirect;
use Request; use Request;
@ -131,8 +130,8 @@ class UserController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('bulk_action'); $action = \Request::input('bulk_action');
$id = Input::get('bulk_public_id'); $id = \Request::input('bulk_public_id');
$user = User::where('account_id', '=', Auth::user()->account_id) $user = User::where('account_id', '=', Auth::user()->account_id)
->where('public_id', '=', $id) ->where('public_id', '=', $id)
@ -184,7 +183,7 @@ class UserController extends BaseController
$rules['email'] = 'required|email|unique:users'; $rules['email'] = 'required|email|unique:users';
} }
$validator = Validator::make(Input::all(), $rules); $validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) { if ($validator->fails()) {
return Redirect::to($userPublicId ? 'users/edit' : 'users/create') return Redirect::to($userPublicId ? 'users/edit' : 'users/create')
@ -192,20 +191,20 @@ class UserController extends BaseController
->withInput(); ->withInput();
} }
if (! \App\Models\LookupUser::validateField('email', Input::get('email'), $user)) { if (! \App\Models\LookupUser::validateField('email', \Request::input('email'), $user)) {
return Redirect::to($userPublicId ? 'users/edit' : 'users/create') return Redirect::to($userPublicId ? 'users/edit' : 'users/create')
->withError(trans('texts.email_taken')) ->withError(trans('texts.email_taken'))
->withInput(); ->withInput();
} }
if ($userPublicId) { if ($userPublicId) {
$user->first_name = trim(Input::get('first_name')); $user->first_name = trim(\Request::input('first_name'));
$user->last_name = trim(Input::get('last_name')); $user->last_name = trim(\Request::input('last_name'));
$user->username = trim(Input::get('email')); $user->username = trim(\Request::input('email'));
$user->email = trim(Input::get('email')); $user->email = trim(\Request::input('email'));
if (Auth::user()->hasFeature(FEATURE_USER_PERMISSIONS)) { if (Auth::user()->hasFeature(FEATURE_USER_PERMISSIONS)) {
$user->is_admin = boolval(Input::get('is_admin')); $user->is_admin = boolval(\Request::input('is_admin'));
$user->permissions = self::formatUserPermissions(Input::get('permissions')); $user->permissions = self::formatUserPermissions(\Request::input('permissions'));
} }
} else { } else {
$lastUser = User::withTrashed()->where('account_id', '=', Auth::user()->account_id) $lastUser = User::withTrashed()->where('account_id', '=', Auth::user()->account_id)
@ -213,23 +212,23 @@ class UserController extends BaseController
$user = new User(); $user = new User();
$user->account_id = Auth::user()->account_id; $user->account_id = Auth::user()->account_id;
$user->first_name = trim(Input::get('first_name')); $user->first_name = trim(\Request::input('first_name'));
$user->last_name = trim(Input::get('last_name')); $user->last_name = trim(\Request::input('last_name'));
$user->username = trim(Input::get('email')); $user->username = trim(\Request::input('email'));
$user->email = trim(Input::get('email')); $user->email = trim(\Request::input('email'));
$user->registered = true; $user->registered = true;
$user->password = strtolower(str_random(RANDOM_KEY_LENGTH)); $user->password = strtolower(str_random(RANDOM_KEY_LENGTH));
$user->confirmation_code = strtolower(str_random(RANDOM_KEY_LENGTH)); $user->confirmation_code = strtolower(str_random(RANDOM_KEY_LENGTH));
$user->public_id = $lastUser->public_id + 1; $user->public_id = $lastUser->public_id + 1;
if (Auth::user()->hasFeature(FEATURE_USER_PERMISSIONS)) { if (Auth::user()->hasFeature(FEATURE_USER_PERMISSIONS)) {
$user->is_admin = boolval(Input::get('is_admin')); $user->is_admin = boolval(\Request::input('is_admin'));
$user->permissions = self::formatUserPermissions(Input::get('permissions')); $user->permissions = self::formatUserPermissions(\Request::input('permissions'));
} }
} }
$user->save(); $user->save();
if (! $user->confirmed && Input::get('action') === 'email') { if (! $user->confirmed && \Request::input('action') === 'email') {
$this->userMailer->sendConfirmation($user, Auth::user()); $this->userMailer->sendConfirmation($user, Auth::user());
$message = trans('texts.sent_invite'); $message = trans('texts.sent_invite');
} else { } else {
@ -306,14 +305,14 @@ class UserController extends BaseController
// check the current password is correct // check the current password is correct
if (! Auth::validate([ if (! Auth::validate([
'email' => Auth::user()->email, 'email' => Auth::user()->email,
'password' => Input::get('current_password'), 'password' => \Request::input('current_password'),
])) { ])) {
return trans('texts.password_error_incorrect'); return trans('texts.password_error_incorrect');
} }
// validate the new password // validate the new password
$password = Input::get('new_password'); $password = \Request::input('new_password');
$confirm = Input::get('confirm_password'); $confirm = \Request::input('confirm_password');
if (strlen($password) < 6 || $password != $confirm) { if (strlen($password) < 6 || $password != $confirm) {
return trans('texts.password_error_invalid'); return trans('texts.password_error_invalid');
@ -389,12 +388,12 @@ class UserController extends BaseController
public function saveSidebarState() public function saveSidebarState()
{ {
if (Input::has('show_left')) { if (Request::has('show_left')) {
Session::put(SESSION_LEFT_SIDEBAR, boolval(Input::get('show_left'))); Session::put(SESSION_LEFT_SIDEBAR, boolval(\Request::input('show_left')));
} }
if (Input::has('show_right')) { if (Request::has('show_right')) {
Session::put(SESSION_RIGHT_SIDEBAR, boolval(Input::get('show_right'))); Session::put(SESSION_RIGHT_SIDEBAR, boolval(\Request::input('show_right')));
} }
return RESULT_SUCCESS; return RESULT_SUCCESS;

View File

@ -8,7 +8,6 @@ use App\Http\Requests\CreateVendorRequest;
use App\Http\Requests\UpdateVendorRequest; use App\Http\Requests\UpdateVendorRequest;
use App\Models\Vendor; use App\Models\Vendor;
use App\Ninja\Repositories\VendorRepository; use App\Ninja\Repositories\VendorRepository;
use Input;
use Response; use Response;
use Utils; use Utils;

View File

@ -12,7 +12,6 @@ use App\Ninja\Repositories\VendorRepository;
use App\Services\VendorService; use App\Services\VendorService;
use Auth; use Auth;
use Cache; use Cache;
use Input;
use Redirect; use Redirect;
use Session; use Session;
use URL; use URL;
@ -49,7 +48,7 @@ class VendorController extends BaseController
public function getDatatable() public function getDatatable()
{ {
return $this->vendorService->getDatatable(Input::get('sSearch')); return $this->vendorService->getDatatable(\Request::input('sSearch'));
} }
/** /**
@ -149,7 +148,7 @@ class VendorController extends BaseController
private static function getViewModel() private static function getViewModel()
{ {
return [ return [
'data' => Input::old('data'), 'data' => \Request::old('data'),
'account' => Auth::user()->account, 'account' => Auth::user()->account,
]; ];
} }
@ -172,8 +171,8 @@ class VendorController extends BaseController
public function bulk() public function bulk()
{ {
$action = Input::get('action'); $action = \Request::input('action');
$ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $ids = \Request::input('public_id') ? \Request::input('public_id') : \Request::input('ids');
$count = $this->vendorService->bulk($ids, $action); $count = $this->vendorService->bulk($ids, $action);
$message = Utils::pluralize($action.'d_vendor', $count); $message = Utils::pluralize($action.'d_vendor', $count);

View File

@ -104,8 +104,9 @@ class ApiCheck
return Response::json("Please wait {$wait} second(s)", 403, $headers); return Response::json("Please wait {$wait} second(s)", 403, $headers);
} }
Cache::put("hour_throttle:{$key}", $new_hour_throttle, 60);
Cache::put("last_api_request:{$key}", time(), 60); Cache::put("hour_throttle:{$key}", $new_hour_throttle, 60 * 60);
Cache::put("last_api_request:{$key}", time(), 60 * 60);
} }
return $next($request); return $next($request);

View File

@ -12,7 +12,6 @@ use Cache;
use Closure; use Closure;
use Event; use Event;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Input;
use Redirect; use Redirect;
use Schema; use Schema;
use Session; use Session;
@ -151,8 +150,8 @@ class StartupCheck
} }
// Check if we're requesting to change the account's language // Check if we're requesting to change the account's language
if (Input::has('lang')) { if (\Request::has('lang')) {
$locale = Input::get('lang'); $locale = \Request::input('lang');
App::setLocale($locale); App::setLocale($locale);
session([SESSION_LOCALE => $locale]); session([SESSION_LOCALE => $locale]);
@ -172,15 +171,15 @@ class StartupCheck
// Make sure the account/user localization settings are in the session // Make sure the account/user localization settings are in the session
if (Auth::check() && ! Session::has(SESSION_TIMEZONE)) { if (Auth::check() && ! Session::has(SESSION_TIMEZONE)) {
Event::fire(new UserLoggedIn()); Event::dispatch(new UserLoggedIn());
} }
// Check if the user is claiming a license (ie, additional invoices, white label, etc.) // Check if the user is claiming a license (ie, additional invoices, white label, etc.)
if (! Utils::isNinjaProd() && isset($_SERVER['REQUEST_URI'])) { if (! Utils::isNinjaProd() && isset($_SERVER['REQUEST_URI'])) {
$claimingLicense = Utils::startsWith($_SERVER['REQUEST_URI'], '/claim_license'); $claimingLicense = Utils::startsWith($_SERVER['REQUEST_URI'], '/claim_license');
if (! $claimingLicense && Input::has('license_key') && Input::has('product_id')) { if (! $claimingLicense && \Request::has('license_key') && \Request::has('product_id')) {
$licenseKey = Input::get('license_key'); $licenseKey = \Request::input('license_key');
$productId = Input::get('product_id'); $productId = \Request::input('product_id');
$url = (Utils::isNinjaDev() ? SITE_URL : NINJA_APP_URL) . "/claim_license?license_key={$licenseKey}&product_id={$productId}&get_date=true"; $url = (Utils::isNinjaDev() ? SITE_URL : NINJA_APP_URL) . "/claim_license?license_key={$licenseKey}&product_id={$productId}&get_date=true";
$data = trim(CurlUtils::get($url)); $data = trim(CurlUtils::get($url));
@ -208,11 +207,11 @@ class StartupCheck
// Check data has been cached // Check data has been cached
$cachedTables = unserialize(CACHED_TABLES); $cachedTables = unserialize(CACHED_TABLES);
if (Input::has('clear_cache')) { if (\Request::has('clear_cache')) {
Session::flash('message', 'Cache cleared'); Session::flash('message', 'Cache cleared');
} }
foreach ($cachedTables as $name => $class) { foreach ($cachedTables as $name => $class) {
if (Input::has('clear_cache') || ! Cache::has($name)) { if (\Request::has('clear_cache') || ! Cache::has($name)) {
// check that the table exists in case the migration is pending // check that the table exists in case the migration is pending
if (! Schema::hasTable((new $class())->getTable())) { if (! Schema::hasTable((new $class())->getTable())) {
continue; continue;

View File

@ -4,7 +4,6 @@ namespace App\Http\Requests;
use App\Libraries\HistoryUtils; use App\Libraries\HistoryUtils;
use App\Models\EntityModel; use App\Models\EntityModel;
use Input;
use Utils; use Utils;
class EntityRequest extends Request class EntityRequest extends Request
@ -33,7 +32,7 @@ class EntityRequest extends Request
} }
} }
if (! $publicId) { if (! $publicId) {
$publicId = Input::get('public_id') ?: Input::get('id'); $publicId = \Request::input('public_id') ?: \Request::input('id');
} }
if (! $publicId) { if (! $publicId) {

View File

@ -10,7 +10,6 @@ use Carbon;
use DateTime; use DateTime;
use DateTimeZone; use DateTimeZone;
use Exception; use Exception;
use Input;
use Log; use Log;
use Request; use Request;
use Schema; use Schema;
@ -437,7 +436,7 @@ class Utils
]; ];
if (static::isNinja()) { if (static::isNinja()) {
$data['url'] = Input::get('url', Request::url()); $data['url'] = \Request::input('url', Request::url());
$data['previous'] = url()->previous(); $data['previous'] = url()->previous();
} else { } else {
$data['url'] = request()->path(); $data['url'] = request()->path();

View File

@ -0,0 +1,23 @@
<?php
namespace App\Logging;
class CustomizeSingleLogger
{
/**
* Customize the given logger instance.
*
* @param \Illuminate\Log\Logger $logger
*
* @return void
*/
public function __invoke($logger)
{
$logger->pushHandler(new \Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-info.log',
\Monolog\Logger::INFO, false));
$logger->pushHandler(new \Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-warning.log',
\Monolog\Logger::WARNING, false));
$logger->pushHandler(new \Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-error.log',
\Monolog\Logger::ERROR, false));
}
}

View File

@ -1963,7 +1963,7 @@ Account::updated(function ($account) {
return; return;
} }
Event::fire(new UserSettingsChanged()); Event::dispatch(new UserSettingsChanged());
}); });
Account::deleted(function ($account) Account::deleted(function ($account)

View File

@ -99,7 +99,7 @@ class LookupModel extends Eloquent
abort(404, "Looked up {$className} not found: {$field} => {$value}"); abort(404, "Looked up {$className} not found: {$field} => {$value}");
} }
Cache::put($key, $server, 120); Cache::put($key, $server, 120 * 60);
} else { } else {
config(['database.default' => $current]); config(['database.default' => $current]);
} }

View File

@ -243,7 +243,7 @@ class Payment extends EntityModel
$this->payment_status_id = $this->refunded == $this->amount ? PAYMENT_STATUS_REFUNDED : PAYMENT_STATUS_PARTIALLY_REFUNDED; $this->payment_status_id = $this->refunded == $this->amount ? PAYMENT_STATUS_REFUNDED : PAYMENT_STATUS_PARTIALLY_REFUNDED;
$this->save(); $this->save();
Event::fire(new PaymentWasRefunded($this, $refund_change)); Event::dispatch(new PaymentWasRefunded($this, $refund_change));
} }
return true; return true;
@ -258,7 +258,7 @@ class Payment extends EntityModel
return false; return false;
} }
Event::fire(new PaymentWasVoided($this)); Event::dispatch(new PaymentWasVoided($this));
$this->refunded = $this->amount; $this->refunded = $this->amount;
$this->payment_status_id = PAYMENT_STATUS_VOIDED; $this->payment_status_id = PAYMENT_STATUS_VOIDED;
@ -271,7 +271,7 @@ class Payment extends EntityModel
{ {
$this->payment_status_id = PAYMENT_STATUS_COMPLETED; $this->payment_status_id = PAYMENT_STATUS_COMPLETED;
$this->save(); $this->save();
Event::fire(new PaymentCompleted($this)); Event::dispatch(new PaymentCompleted($this));
} }
/** /**
@ -282,7 +282,7 @@ class Payment extends EntityModel
$this->payment_status_id = PAYMENT_STATUS_FAILED; $this->payment_status_id = PAYMENT_STATUS_FAILED;
$this->gateway_error = $failureMessage; $this->gateway_error = $failureMessage;
$this->save(); $this->save();
Event::fire(new PaymentFailed($this)); Event::dispatch(new PaymentFailed($this));
} }
/** /**

View File

@ -220,11 +220,11 @@ class PaymentMethod extends EntityModel
} }
if (! empty($data)) { if (! empty($data)) {
Cache::put('bankData:'.$routingNumber, $data, 5); Cache::put('bankData:'.$routingNumber, $data, 5 * 60);
return $data; return $data;
} else { } else {
Cache::put('bankData:'.$routingNumber, false, 5); Cache::put('bankData:'.$routingNumber, false, 5 * 60);
return null; return null;
} }

View File

@ -402,8 +402,8 @@ class ContactMailer extends Mailer
$day_hits_remaining = $day_hits_remaining >= 0 ? $day_hits_remaining : 0; $day_hits_remaining = $day_hits_remaining >= 0 ? $day_hits_remaining : 0;
} }
Cache::put("email_day_throttle:{$key}", $new_day_throttle, 60); Cache::put("email_day_throttle:{$key}", $new_day_throttle, 60 * 60);
Cache::put("last_email_request:{$key}", time(), 60); Cache::put("last_email_request:{$key}", time(), 60 * 60);
if ($new_day_throttle > $day) { if ($new_day_throttle > $day) {
$errorEmail = env('ERROR_EMAIL'); $errorEmail = env('ERROR_EMAIL');
@ -414,7 +414,7 @@ class ContactMailer extends Mailer
->subject("Email throttle triggered for account " . $account->id); ->subject("Email throttle triggered for account " . $account->id);
}); });
} }
Cache::put("throttle_notified:{$key}", true, 60 * 24); Cache::put("throttle_notified:{$key}", true, 60 * 24 * 60);
return true; return true;
} }

View File

@ -18,7 +18,6 @@ use App\Models\User;
use App\Models\UserAccount; use App\Models\UserAccount;
use App\Models\LookupUser; use App\Models\LookupUser;
use Auth; use Auth;
use Input;
use Request; use Request;
use Schema; use Schema;
use Session; use Session;
@ -37,19 +36,19 @@ class AccountRepository
} }
$company = new Company(); $company = new Company();
$company->utm_source = Input::get('utm_source'); $company->utm_source = \Request::input('utm_source');
$company->utm_medium = Input::get('utm_medium'); $company->utm_medium = \Request::input('utm_medium');
$company->utm_campaign = Input::get('utm_campaign'); $company->utm_campaign = \Request::input('utm_campaign');
$company->utm_term = Input::get('utm_term'); $company->utm_term = \Request::input('utm_term');
$company->utm_content = Input::get('utm_content'); $company->utm_content = \Request::input('utm_content');
$company->referral_code = Session::get(SESSION_REFERRAL_CODE); $company->referral_code = Session::get(SESSION_REFERRAL_CODE);
if (Input::get('utm_campaign')) { if (\Request::input('utm_campaign')) {
if (env('PROMO_CAMPAIGN') && hash_equals(Input::get('utm_campaign'), env('PROMO_CAMPAIGN'))) { if (env('PROMO_CAMPAIGN') && hash_equals(\Request::input('utm_campaign'), env('PROMO_CAMPAIGN'))) {
$company->applyDiscount(.75); $company->applyDiscount(.75);
} elseif (env('PARTNER_CAMPAIGN') && hash_equals(Input::get('utm_campaign'), env('PARTNER_CAMPAIGN'))) { } elseif (env('PARTNER_CAMPAIGN') && hash_equals(\Request::input('utm_campaign'), env('PARTNER_CAMPAIGN'))) {
$company->applyFreeYear(); $company->applyFreeYear();
} elseif (env('EDUCATION_CAMPAIGN') && hash_equals(Input::get('utm_campaign'), env('EDUCATION_CAMPAIGN'))) { } elseif (env('EDUCATION_CAMPAIGN') && hash_equals(\Request::input('utm_campaign'), env('EDUCATION_CAMPAIGN'))) {
$company->applyFreeYear(2); $company->applyFreeYear(2);
} }
} else { } else {

View File

@ -3,6 +3,7 @@
namespace App\Providers; namespace App\Providers;
use Form; use Form;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Request; use Request;
use URL; use URL;
@ -26,6 +27,7 @@ class AppServiceProvider extends ServiceProvider
public function boot() public function boot()
{ {
Route::singularResourceParameters(false); Route::singularResourceParameters(false);
Paginator::useBootstrapThree();
// support selecting job database // support selecting job database
Queue::before(function (JobProcessing $event) { Queue::before(function (JobProcessing $event) {

View File

@ -6,7 +6,6 @@ use App\Events\UserLoggedIn;
use App\Ninja\Repositories\AccountRepository; use App\Ninja\Repositories\AccountRepository;
use App\Models\LookupUser; use App\Models\LookupUser;
use Auth; use Auth;
use Input;
use Session; use Session;
use Socialite; use Socialite;
use Utils; use Utils;
@ -98,7 +97,7 @@ class AuthService
} }
} }
$redirectTo = Input::get('redirect_to') ? SITE_URL . '/' . ltrim(Input::get('redirect_to'), '/') : 'dashboard'; $redirectTo = \Request::input('redirect_to') ? SITE_URL . '/' . ltrim(\Request::input('redirect_to'), '/') : 'dashboard';
return redirect()->to($redirectTo); return redirect()->to($redirectTo);
} }

View File

@ -58,14 +58,6 @@ if (strstr($_SERVER['HTTP_USER_AGENT'], 'PhantomJS') && Utils::isNinjaDev()) {
} }
*/ */
$app->configureMonologUsing(function($monolog) {
if (config('app.log') == 'single') {
$monolog->pushHandler(new Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-info.log', Monolog\Logger::INFO, false));
$monolog->pushHandler(new Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-warning.log', Monolog\Logger::WARNING, false));
$monolog->pushHandler(new Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-error.log', Monolog\Logger::ERROR, false));
}
});
// Capture real IP if using cloudflare // Capture real IP if using cloudflare
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) { if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"]; $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];

View File

@ -18,22 +18,35 @@
"ext-gmp": "*", "ext-gmp": "*",
"ext-json": "*", "ext-json": "*",
"ext-zip": "*", "ext-zip": "*",
"abdala/omnipay-pagseguro": "0.2",
"agmscode/omnipay-agms": "~1.0",
"anahkiasen/former": "4.*", "anahkiasen/former": "4.*",
"andreas22/omnipay-fasapay": "1.*",
"asgrim/ofxparser": "^1.1", "asgrim/ofxparser": "^1.1",
"bacon/bacon-qr-code": "^1.0", "bacon/bacon-qr-code": "^1.0",
"barracudanetworks/archivestream-php": "^1.0", "barracudanetworks/archivestream-php": "^1.0",
"barryvdh/laravel-cors": "^0.9.1", "barryvdh/laravel-cors": "^1.0.6",
"barryvdh/laravel-debugbar": "~3.0.1", "barryvdh/laravel-debugbar": "~3.6.1",
"barryvdh/laravel-ide-helper": "~2.2", "barryvdh/laravel-ide-helper": "~2.7",
"bramdevries/omnipay-paymill": "^1.0",
"cardgate/omnipay-cardgate": "~2.0",
"cerdic/css-tidy": "~v1.5", "cerdic/css-tidy": "~v1.5",
"chumper/datatable": "dev-add-back-options", "chumper/datatable": "dev-laravel6-support",
"cleverit/ubl_invoice": "1.*", "cleverit/ubl_invoice": "1.*",
"codedge/laravel-selfupdater": "2.2.0", "codedge/laravel-selfupdater": "2.3.0",
"collizo4sky/omnipay-wepay": "dev-address-fix#942f3e0", "collizo4sky/omnipay-wepay": "dev-address-fix#942f3e0",
"delatbabel/omnipay-fatzebra": "dev-master",
"dercoder/omnipay-ecopayz": "~1.0",
"dercoder/omnipay-paysafecard": "dev-master",
"digitickets/omnipay-barclays-epdq": "~3.0",
"digitickets/omnipay-datacash": "~3.0",
"digitickets/omnipay-gocardlessv2": "dev-payment-fix", "digitickets/omnipay-gocardlessv2": "dev-payment-fix",
"doctrine/dbal": "2.5.x", "digitickets/omnipay-realex": "~5.0",
"doctrine/dbal": "2.6.x",
"dompdf/dompdf": "0.6.2", "dompdf/dompdf": "0.6.2",
"ezyang/htmlpurifier": "~v4.7", "ezyang/htmlpurifier": "~v4.7",
"fotografde/omnipay-checkoutcom": "~2.0",
"fruitcakestudio/omnipay-sisow": "~2.0",
"fzaninotto/faker": "^1.5", "fzaninotto/faker": "^1.5",
"google/apiclient": "^2.0", "google/apiclient": "^2.0",
"guzzlehttp/guzzle": "^6.3", "guzzlehttp/guzzle": "^6.3",
@ -41,68 +54,58 @@
"jaybizzle/laravel-crawler-detect": "1.*", "jaybizzle/laravel-crawler-detect": "1.*",
"jlapp/swaggervel": "master-dev", "jlapp/swaggervel": "master-dev",
"jonnyw/php-phantomjs": "dev-fixes", "jonnyw/php-phantomjs": "dev-fixes",
"justinbusschau/omnipay-secpay": "~2.0",
"laracasts/presenter": "dev-master", "laracasts/presenter": "dev-master",
"turbo124/framework": "5.5.51", "laravel/framework": "^6.20",
"laravel/helpers": "^1.4",
"laravel/legacy-encrypter": "^1.0", "laravel/legacy-encrypter": "^1.0",
"laravel/socialite": "3.0.x-dev", "laravel/socialite": "~4.4.1",
"laravel/tinker": "^1.0", "laravel/tinker": "^1.0",
"laravelcollective/html": "5.5.*", "laravelcollective/html": "^6.2",
"league/csv": "^9.1", "league/csv": "^9.1",
"league/flysystem-aws-s3-v3": "~1.0", "league/flysystem-aws-s3-v3": "~1.0",
"league/flysystem-rackspace": "~1.0", "league/flysystem-rackspace": "~1.0",
"league/fractal": "0.13.*", "league/fractal": "0.13.*",
"maatwebsite/excel": "~2.0",
"mashape/unirest-php": "^3.0",
"mpdf/mpdf": "7.1.7",
"nesbot/carbon": "^1.26",
"nwidart/laravel-modules": "2.0.*",
"omnipay/authorizenet": "dev-solution-id as 2.5.0",
"omnipay/firstdata": "^2.4",
"patricktalmadge/bootstrapper": "5.5.x",
"turbo124/google2fa-laravel": "0.1.2",
"predis/predis": "^1.1",
"simshaun/recurr": "dev-master",
"stripe/stripe-php": "^6.40",
"symfony/css-selector": "~3.1",
"turbo124/laravel-push-notification": "2.*",
"webpatser/laravel-countries": "dev-master#75992ad",
"websight/l5-google-cloud-storage": "dev-master",
"wepay/php-sdk": "^0.2",
"wildbit/postmark-php": "^2.5",
"abdala/omnipay-pagseguro": "0.2",
"agmscode/omnipay-agms": "~1.0",
"andreas22/omnipay-fasapay": "1.*",
"bramdevries/omnipay-paymill": "^1.0",
"cardgate/omnipay-cardgate": "~2.0",
"delatbabel/omnipay-fatzebra": "dev-master",
"dercoder/omnipay-ecopayz": "~1.0",
"dercoder/omnipay-paysafecard": "dev-master",
"digitickets/omnipay-barclays-epdq": "~3.0",
"digitickets/omnipay-datacash": "~3.0",
"digitickets/omnipay-realex": "~5.0",
"fotografde/omnipay-checkoutcom": "~2.0",
"fruitcakestudio/omnipay-sisow": "~2.0",
"justinbusschau/omnipay-secpay": "~2.0",
"lokielse/omnipay-alipay": "~1.4", "lokielse/omnipay-alipay": "~1.4",
"maatwebsite/excel": "dev-carbon#8b17952",
"mashape/unirest-php": "^3.0",
"meebio/omnipay-creditcall": "dev-master", "meebio/omnipay-creditcall": "dev-master",
"meebio/omnipay-secure-trading": "dev-master", "meebio/omnipay-secure-trading": "dev-master",
"mfauveau/omnipay-pacnet": "~2.0", "mfauveau/omnipay-pacnet": "~2.0",
"mpdf/mpdf": "7.1.7",
"nesbot/carbon": "^2.0",
"nwidart/laravel-modules": "2.0.*",
"omnipay/authorizenet": "dev-solution-id as 2.5.0",
"omnipay/bitpay": "dev-master", "omnipay/bitpay": "dev-master",
"omnipay/braintree": "^1.1", "omnipay/braintree": "^1.1",
"omnipay/common": "2.5.2",
"omnipay/firstdata": "^2.4",
"omnipay/gocardless": "dev-master", "omnipay/gocardless": "dev-master",
"omnipay/mollie": "3.*", "omnipay/mollie": "3.*",
"omnipay/omnipay": "~2.3", "omnipay/omnipay": "~2.3",
"omnipay/payfast": "~2.0", "omnipay/payfast": "~2.0",
"omnipay/stripe": "~2.0", "omnipay/stripe": "~2.0",
"patricktalmadge/bootstrapper": "5.12.x",
"pragmarx/google2fa-laravel": "0.1.4",
"predis/predis": "^1.1",
"simshaun/recurr": "dev-master",
"softcommerce/omnipay-paytrace": "~1.0", "softcommerce/omnipay-paytrace": "~1.0",
"stripe/stripe-php": "^6.40",
"superbalist/laravel-google-cloud-storage": "^2.2",
"symfony/css-selector": "~3.1",
"therobfonz/laravel-mandrill-driver": "~1.0",
"turbo124/laravel-push-notification": "dev-laravel6",
"vemcogroup/laravel-sparkpost-driver": "~2.0",
"vink/omnipay-komoju": "~1.0", "vink/omnipay-komoju": "~1.0",
"omnipay/common": "2.5.2" "webpatser/laravel-countries": "dev-master#75992ad",
"wepay/php-sdk": "^0.2",
"wildbit/postmark-php": "^2.5"
}, },
"require-dev": { "require-dev": {
"symfony/dom-crawler": "~3.1", "symfony/dom-crawler": "~3.1",
"codeception/c3": "2.*", "codeception/c3": "2.*",
"codeception/codeception": "2.*", "codeception/codeception": "2.*",
"phpspec/phpspec": "~2.1", "phpspec/phpspec": "~5.0",
"phpunit/phpunit": "~5.7" "phpunit/phpunit": "~5.7"
}, },
"autoload": { "autoload": {
@ -174,11 +177,11 @@
}, },
{ {
"type": "vcs", "type": "vcs",
"url": "https://github.com/hillelcoren/datatable" "url": "https://github.com/joshuadwire/chumper-datatable"
}, },
{ {
"type": "vcs", "type": "vcs",
"url": "https://github.com/hillelcoren/php-phantomjs" "url": "https://github.com/joshuadwire/php-phantomjs"
}, },
{ {
"type": "vcs", "type": "vcs",
@ -187,6 +190,22 @@
{ {
"type": "vcs", "type": "vcs",
"url": "https://github.com/hillelcoren/omnipay-authorizenet" "url": "https://github.com/hillelcoren/omnipay-authorizenet"
},
{
"type": "vcs",
"url": "https://github.com/joshuadwire/omnipay-common"
},
{
"type": "vcs",
"url": "https://github.com/joshuadwire/laravel-push-notification"
},
{
"type": "vcs",
"url": "https://github.com/joshuadwire/NotificationPusher"
},
{
"type": "vcs",
"url": "https://github.com/tainmar/Laravel-Excel"
} }
] ]
} }

5384
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -88,21 +88,6 @@ return [
'cipher' => env('APP_CIPHER', 'AES-256-CBC'), 'cipher' => env('APP_CIPHER', 'AES-256-CBC'),
/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Settings: "single", "daily", "syslog", "errorlog"
|
*/
'log' => env('LOG', 'single'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Autoloaded Service Providers | Autoloaded Service Providers
@ -155,11 +140,10 @@ return [
'Laravel\Socialite\SocialiteServiceProvider', 'Laravel\Socialite\SocialiteServiceProvider',
'Jlapp\Swaggervel\SwaggervelServiceProvider', 'Jlapp\Swaggervel\SwaggervelServiceProvider',
'Maatwebsite\Excel\ExcelServiceProvider', 'Maatwebsite\Excel\ExcelServiceProvider',
Websight\GcsProvider\CloudStorageServiceProvider::class, Jaybizzle\LaravelCrawlerDetect\LaravelCrawlerDetectServiceProvider::class,
'Jaybizzle\LaravelCrawlerDetect\LaravelCrawlerDetectServiceProvider',
Codedge\Updater\UpdaterServiceProvider::class, Codedge\Updater\UpdaterServiceProvider::class,
Nwidart\Modules\LaravelModulesServiceProvider::class, Nwidart\Modules\LaravelModulesServiceProvider::class,
Barryvdh\Cors\ServiceProvider::class, Fruitcake\Cors\CorsServiceProvider::class,
PragmaRX\Google2FALaravel\ServiceProvider::class, PragmaRX\Google2FALaravel\ServiceProvider::class,
'Chumper\Datatable\DatatableServiceProvider', 'Chumper\Datatable\DatatableServiceProvider',
Laravel\Tinker\TinkerServiceProvider::class, Laravel\Tinker\TinkerServiceProvider::class,
@ -175,7 +159,6 @@ return [
'App\Providers\RouteServiceProvider', 'App\Providers\RouteServiceProvider',
'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider', 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
'Davibennun\LaravelPushNotification\LaravelPushNotificationServiceProvider',
], ],
@ -203,76 +186,75 @@ return [
'Cookie' => 'Illuminate\Support\Facades\Cookie', 'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt', 'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB', 'DB' => 'Illuminate\Support\Facades\DB',
'Eloquent' => 'Illuminate\Database\Eloquent\Model', 'Eloquent' => 'Illuminate\Database\Eloquent\Model',
'Event' => 'Illuminate\Support\Facades\Event', 'Event' => 'Illuminate\Support\Facades\Event',
'File' => 'Illuminate\Support\Facades\File', 'File' => 'Illuminate\Support\Facades\File',
'Gate' => 'Illuminate\Support\Facades\Gate', 'Gate' => 'Illuminate\Support\Facades\Gate',
'Hash' => 'Illuminate\Support\Facades\Hash', 'Hash' => 'Illuminate\Support\Facades\Hash',
'Input' => 'Illuminate\Support\Facades\Input', 'Input' => 'Illuminate\Support\Facades\Input',
'Lang' => 'Illuminate\Support\Facades\Lang', 'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log', 'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail', 'Mail' => 'Illuminate\Support\Facades\Mail',
'Password' => 'Illuminate\Support\Facades\Password', 'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue', 'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect', 'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis', 'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request', 'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response', 'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route', 'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema', 'Schema' => 'Illuminate\Support\Facades\Schema',
'Seeder' => 'Illuminate\Database\Seeder', 'Seeder' => 'Illuminate\Database\Seeder',
'Session' => 'Illuminate\Support\Facades\Session', 'Session' => 'Illuminate\Support\Facades\Session',
'Storage' => 'Illuminate\Support\Facades\Storage', 'Storage' => 'Illuminate\Support\Facades\Storage',
'Str' => 'Illuminate\Support\Str', 'Str' => 'Illuminate\Support\Str',
'URL' => 'Illuminate\Support\Facades\URL', 'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator', 'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View', 'View' => 'Illuminate\Support\Facades\View',
// Added Class Aliases // Added Class Aliases
'Form' => 'Collective\Html\FormFacade', 'Form' => 'Collective\Html\FormFacade',
'HTML' => 'Collective\Html\HtmlFacade', 'HTML' => 'Collective\Html\HtmlFacade',
'SSH' => 'Illuminate\Support\Facades\SSH', 'SSH' => 'Illuminate\Support\Facades\SSH',
'Alert' => 'Bootstrapper\Facades\Alert', 'Alert' => 'Bootstrapper\Facades\Alert',
'Badge' => 'Bootstrapper\Facades\Badge', 'Badge' => 'Bootstrapper\Facades\Badge',
'Breadcrumb' => 'Bootstrapper\Facades\Breadcrumb', 'Breadcrumb' => 'Bootstrapper\Facades\Breadcrumb',
'Button' => 'Bootstrapper\Facades\Button', 'Button' => 'Bootstrapper\Facades\Button',
'ButtonGroup' => 'Bootstrapper\Facades\ButtonGroup', 'ButtonGroup' => 'Bootstrapper\Facades\ButtonGroup',
'ButtonToolbar' => 'Bootstrapper\Facades\ButtonToolbar', 'ButtonToolbar' => 'Bootstrapper\Facades\ButtonToolbar',
'Carousel' => 'Bootstrapper\Facades\Carousel', 'Carousel' => 'Bootstrapper\Facades\Carousel',
'DropdownButton' => 'Bootstrapper\Facades\DropdownButton', 'DropdownButton' => 'Bootstrapper\Facades\DropdownButton',
'Helpers' => 'Bootstrapper\Facades\Helpers', 'Helpers' => 'Bootstrapper\Facades\Helpers',
'Icon' => 'Bootstrapper\Facades\Icon', 'Icon' => 'Bootstrapper\Facades\Icon',
'Label' => 'Bootstrapper\Facades\Label', 'Label' => 'Bootstrapper\Facades\Label',
'MediaObject' => 'Bootstrapper\Facades\MediaObject', 'MediaObject' => 'Bootstrapper\Facades\MediaObject',
'Navbar' => 'Bootstrapper\Facades\Navbar', 'Navbar' => 'Bootstrapper\Facades\Navbar',
'Navigation' => 'Bootstrapper\Facades\Navigation', 'Navigation' => 'Bootstrapper\Facades\Navigation',
'Paginator' => 'Bootstrapper\Facades\Paginator', 'Paginator' => 'Bootstrapper\Facades\Paginator',
'Progress' => 'Bootstrapper\Facades\Progress', 'Progress' => 'Bootstrapper\Facades\Progress',
'Tabbable' => 'Bootstrapper\Facades\Tabbable', 'Tabbable' => 'Bootstrapper\Facades\Tabbable',
'Table' => 'Bootstrapper\Facades\Table', 'Table' => 'Bootstrapper\Facades\Table',
'Thumbnail' => 'Bootstrapper\Facades\Thumbnail', 'Thumbnail' => 'Bootstrapper\Facades\Thumbnail',
'Typeahead' => 'Bootstrapper\Facades\Typeahead', 'Typeahead' => 'Bootstrapper\Facades\Typeahead',
'Typography' => 'Bootstrapper\Facades\Typography', 'Typography' => 'Bootstrapper\Facades\Typography',
'Former' => 'Former\Facades\Former', 'Former' => 'Former\Facades\Former',
'Omnipay' => 'Omnipay\Omnipay', 'Omnipay' => 'Omnipay\Omnipay',
'CreditCard' => 'Omnipay\Common\CreditCard', 'CreditCard' => 'Omnipay\Common\CreditCard',
'Image' => 'Intervention\Image\Facades\Image', 'Image' => 'Intervention\Image\Facades\Image',
'Countries' => 'Webpatser\Countries\CountriesFacade', 'Countries' => 'Webpatser\Countries\CountriesFacade',
'Carbon' => 'Carbon\Carbon', 'Carbon' => 'Carbon\Carbon',
'Rocketeer' => 'Rocketeer\Facades\Rocketeer', 'Rocketeer' => 'Rocketeer\Facades\Rocketeer',
'Socialite' => 'Laravel\Socialite\Facades\Socialite', 'Socialite' => 'Laravel\Socialite\Facades\Socialite',
'Excel' => 'Maatwebsite\Excel\Facades\Excel', 'Excel' => 'Maatwebsite\Excel\Facades\Excel',
'PushNotification' => 'Davibennun\LaravelPushNotification\Facades\PushNotification', 'Crawler' => Jaybizzle\LaravelCrawlerDetect\Facades\LaravelCrawlerDetect::class,
'Crawler' => 'Jaybizzle\LaravelCrawlerDetect\Facades\LaravelCrawlerDetect', 'Datatable' => 'Chumper\Datatable\Facades\DatatableFacade',
'Datatable' => 'Chumper\Datatable\Facades\DatatableFacade', 'Updater' => Codedge\Updater\UpdaterFacade::class,
'Updater' => Codedge\Updater\UpdaterFacade::class, 'Module' => Nwidart\Modules\Facades\Module::class,
'Module' => Nwidart\Modules\Facades\Module::class,
'Utils' => App\Libraries\Utils::class, 'Utils' => App\Libraries\Utils::class,
'DateUtils' => App\Libraries\DateUtils::class, 'DateUtils' => App\Libraries\DateUtils::class,
'HTMLUtils' => App\Libraries\HTMLUtils::class, 'HTMLUtils' => App\Libraries\HTMLUtils::class,
'CurlUtils' => App\Libraries\CurlUtils::class, 'CurlUtils' => App\Libraries\CurlUtils::class,
'Domain' => App\Constants\Domain::class, 'Domain' => App\Constants\Domain::class,
'Google2FA' => PragmaRX\Google2FALaravel\Facade::class, 'Google2FA' => PragmaRX\Google2FALaravel\Facade::class,
], ],

View File

@ -10,11 +10,11 @@ return [
| to accept any value. | to accept any value.
| |
*/ */
'supportsCredentials' => false, 'supports_credentials' => false,
'allowedOrigins' => ['*'], 'allowed_origins' => ['*'],
'allowedHeaders' => ['*'], 'allowed_headers' => ['*'],
'allowedMethods' => ['*'], 'allowed_methods' => ['*'],
'exposedHeaders' => [], 'exposed_headers' => [],
'maxAge' => 0, 'max_age' => 0,
]; ];

View File

@ -133,6 +133,7 @@ return [
'redis' => [ 'redis' => [
'cluster' => false, 'cluster' => false,
'client' => 'predis',
'default' => [ 'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'), 'host' => env('REDIS_HOST', '127.0.0.1'),

122
config/datatables.php Normal file
View File

@ -0,0 +1,122 @@
<?php
return [
/*
* DataTables search options.
*/
'search' => [
/*
* Smart search will enclose search keyword with wildcard string "%keyword%".
* SQL: column LIKE "%keyword%"
*/
'smart' => true,
/*
* Multi-term search will explode search keyword using spaces resulting into multiple term search.
*/
'multi_term' => true,
/*
* Case insensitive will search the keyword in lower case format.
* SQL: LOWER(column) LIKE LOWER(keyword)
*/
'case_insensitive' => true,
/*
* Wild card will add "%" in between every characters of the keyword.
* SQL: column LIKE "%k%e%y%w%o%r%d%"
*/
'use_wildcards' => false,
/*
* Perform a search which starts with the given keyword.
* SQL: column LIKE "keyword%"
*/
'starts_with' => false,
],
/*
* DataTables internal index id response column name.
*/
'index_column' => 'DT_RowIndex',
/*
* List of available builders for DataTables.
* This is where you can register your custom dataTables builder.
*/
'engines' => [
'eloquent' => Yajra\DataTables\EloquentDataTable::class,
'query' => Yajra\DataTables\QueryDataTable::class,
'collection' => Yajra\DataTables\CollectionDataTable::class,
'resource' => Yajra\DataTables\ApiResourceDataTable::class,
],
/*
* DataTables accepted builder to engine mapping.
* This is where you can override which engine a builder should use
* Note, only change this if you know what you are doing!
*/
'builders' => [
//Illuminate\Database\Eloquent\Relations\Relation::class => 'eloquent',
//Illuminate\Database\Eloquent\Builder::class => 'eloquent',
//Illuminate\Database\Query\Builder::class => 'query',
//Illuminate\Support\Collection::class => 'collection',
],
/*
* Nulls last sql pattern for PostgreSQL & Oracle.
* For MySQL, use 'CASE WHEN :column IS NULL THEN 1 ELSE 0 END, :column :direction'
*/
'nulls_last_sql' => ':column :direction NULLS LAST',
/*
* User friendly message to be displayed on user if error occurs.
* Possible values:
* null - The exception message will be used on error response.
* 'throw' - Throws a \Yajra\DataTables\Exceptions\Exception. Use your custom error handler if needed.
* 'custom message' - Any friendly message to be displayed to the user. You can also use translation key.
*/
'error' => env('DATATABLES_ERROR', null),
/*
* Default columns definition of dataTable utility functions.
*/
'columns' => [
/*
* List of columns hidden/removed on json response.
*/
'excess' => ['rn', 'row_num'],
/*
* List of columns to be escaped. If set to *, all columns are escape.
* Note: You can set the value to empty array to disable XSS protection.
*/
'escape' => '*',
/*
* List of columns that are allowed to display html content.
* Note: Adding columns to list will make us available to XSS attacks.
*/
'raw' => ['action'],
/*
* List of columns are are forbidden from being searched/sorted.
*/
'blacklist' => ['password', 'remember_token'],
/*
* List of columns that are only allowed fo search/sort.
* If set to *, all columns are allowed.
*/
'whitelist' => '*',
],
/*
* JsonResponse header and options config.
*/
'json' => [
'header' => [],
'options' => 0,
],
];

View File

@ -83,7 +83,7 @@ return [
//'service_account_certificate' => storage_path() . '/credentials.p12', //'service_account_certificate' => storage_path() . '/credentials.p12',
//'service_account_certificate_password' => env('GCS_PASSWORD', ''), //'service_account_certificate_password' => env('GCS_PASSWORD', ''),
'project_id' => env('GCS_PROJECT_ID'), 'project_id' => env('GCS_PROJECT_ID'),
'credentials' => storage_path() . '/gcs-credentials.json', 'key_file' => storage_path() . '/gcs-credentials.json',
], ],
], ],

52
config/hashing.php Normal file
View File

@ -0,0 +1,52 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
];

82
config/logging.php Normal file
View File

@ -0,0 +1,82 @@
<?php
use Monolog\Handler\StreamHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', env('LOG', 'stack')),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'tap'=>[\App\Logging\CustomizeSingleLogger::class]
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 7,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
],
'stderr' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
],
],
];

View File

@ -18,7 +18,7 @@
{{ Former::populateField('dark_mode', intval($user->dark_mode)) }} {{ Former::populateField('dark_mode', intval($user->dark_mode)) }}
{{ Former::populateField('enable_two_factor', $user->google_2fa_secret ? 1 : 0) }} {{ Former::populateField('enable_two_factor', $user->google_2fa_secret ? 1 : 0) }}
@if (Input::has('affiliate')) @if (Request::has('affiliate'))
{{ Former::populateField('referral_code', true) }} {{ Former::populateField('referral_code', true) }}
@endif @endif

View File

@ -173,8 +173,8 @@
@yield('onReady') @yield('onReady')
@if (Input::has('focus')) @if (\Request::has('focus'))
$('#{{ Input::get('focus') }}').focus(); $('#{{ \Request::input('focus') }}').focus();
@endif @endif
// Focus the search input if the user clicks forward slash // Focus the search input if the user clicks forward slash

View File

@ -259,8 +259,8 @@
} }
$(function() { $(function() {
@if (Input::has('phantomjs')) @if (Request::has('phantomjs'))
@if (Input::has('phantomjs_balances')) @if (Request::has('phantomjs_balances'))
document.write(calculateAmounts(invoice).total_amount); document.write(calculateAmounts(invoice).total_amount);
document.close(); document.close();
if (window.hasOwnProperty('pjsc_meta')) { if (window.hasOwnProperty('pjsc_meta')) {

View File

@ -53,8 +53,8 @@
} }
$(function() { $(function() {
@if (Input::has('phantomjs')) @if (Request::has('phantomjs'))
@if (Input::has('phantomjs_balances')) @if (Request::has('phantomjs_balances'))
document.write(calculateAmounts(invoice).total_amount); document.write(calculateAmounts(invoice).total_amount);
document.close(); document.close();
if (window.hasOwnProperty('pjsc_meta')) { if (window.hasOwnProperty('pjsc_meta')) {

View File

@ -44,7 +44,7 @@
<div id="top_right_buttons" class="pull-right"> <div id="top_right_buttons" class="pull-right">
<input id="tableFilter_{{ $entityType }}" type="text" style="width:180px;margin-right:17px;background-color: white !important" <input id="tableFilter_{{ $entityType }}" type="text" style="width:180px;margin-right:17px;background-color: white !important"
class="form-control pull-left" placeholder="{{ trans('texts.filter') }}" value="{{ Input::get('filter') }}"/> class="form-control pull-left" placeholder="{{ trans('texts.filter') }}" value="{{ \Request::input('filter') }}"/>
@if ($entityType == ENTITY_PROPOSAL) @if ($entityType == ENTITY_PROPOSAL)
{!! DropdownButton::normal(trans('texts.proposal_templates')) {!! DropdownButton::normal(trans('texts.proposal_templates'))

View File

@ -20,7 +20,7 @@ $(function() {
@if (Auth::check() && !Utils::isNinja() && ! Auth::user()->registered) @if (Auth::check() && !Utils::isNinja() && ! Auth::user()->registered)
$('#closeSignUpButton').hide(); $('#closeSignUpButton').hide();
showSignUp(); showSignUp();
@elseif(Session::get('sign_up') || Input::get('sign_up')) @elseif(Session::get('sign_up') || \Request::input('sign_up'))
showSignUp(); showSignUp();
@endif @endif

View File

@ -169,7 +169,7 @@
$('#payment_type_id option:contains("{{ trans('texts.apply_credit') }}")').text("{{ trans('texts.apply_credit') }} | {{ $totalCredit}}"); $('#payment_type_id option:contains("{{ trans('texts.apply_credit') }}")').text("{{ trans('texts.apply_credit') }} | {{ $totalCredit}}");
@endif @endif
@if (Input::old('data')) @if (Request::old('data'))
// this means we failed so we'll reload the previous state // this means we failed so we'll reload the previous state
window.model = new ViewModel({!! $data !!}); window.model = new ViewModel({!! $data !!});
@else @else

View File

@ -12,8 +12,8 @@
{!! Form::open(array('url' => 'get_started', 'id' => 'startForm')) !!} {!! Form::open(array('url' => 'get_started', 'id' => 'startForm')) !!}
{!! Form::hidden('guest_key') !!} {!! Form::hidden('guest_key') !!}
{!! Form::hidden('sign_up', Input::get('sign_up')) !!} {!! Form::hidden('sign_up', \Request::input('sign_up')) !!}
{!! Form::hidden('redirect_to', Input::get('redirect_to')) !!} {!! Form::hidden('redirect_to', \Request::input('redirect_to')) !!}
{!! Form::close() !!} {!! Form::close() !!}
<script> <script>

View File

@ -4,8 +4,8 @@
{!! Form::open(array('url' => 'get_started?' . request()->getQueryString(), 'id' => 'startForm')) !!} {!! Form::open(array('url' => 'get_started?' . request()->getQueryString(), 'id' => 'startForm')) !!}
{!! Form::hidden('guest_key') !!} {!! Form::hidden('guest_key') !!}
{!! Form::hidden('sign_up', Input::get('sign_up')) !!} {!! Form::hidden('sign_up', \Request::input('sign_up')) !!}
{!! Form::hidden('redirect_to', Input::get('redirect_to')) !!} {!! Form::hidden('redirect_to', \Request::input('redirect_to')) !!}
{!! Form::close() !!} {!! Form::close() !!}
<script> <script>

View File

@ -536,7 +536,7 @@
@endif @endif
@if ($errors->first('time_log')) @if ($errors->first('time_log'))
loadTimeLog({!! json_encode(Input::old('time_log')) !!}); loadTimeLog({!! json_encode(Request::old('time_log')) !!});
model.showTimeOverlaps(); model.showTimeOverlaps();
showTimeDetails(); showTimeDetails();
@endif @endif

View File

@ -1,2 +1,3 @@
* *
!data/
!.gitignore !.gitignore