mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Update Namespaces & Syntax
This commit is contained in:
parent
59a94e4b2c
commit
9af731545c
@ -3,7 +3,7 @@
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use ninja\mailers\ContactMailer as Mailer;
|
||||
use Ninja\Mailers\ContactMailer as Mailer;
|
||||
|
||||
class SendRecurringInvoices extends Command
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
<?php namespace App\Handlers;
|
||||
|
||||
use ninja\mailers\UserMailer;
|
||||
use ninja\mailers\ContactMailer;
|
||||
use Ninja\Mailers\UserMailer;
|
||||
use Ninja\Mailers\ContactMailer;
|
||||
|
||||
class InvoiceEventHandler
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php namespace App\Handlers;
|
||||
|
||||
class UserEventHandler
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use ninja\repositories\AccountRepository;
|
||||
use ninja\mailers\UserMailer;
|
||||
use ninja\mailers\ContactMailer;
|
||||
use Ninja\Repositories\AccountRepository;
|
||||
use Ninja\Mailers\UserMailer;
|
||||
use Ninja\Mailers\ContactMailer;
|
||||
|
||||
class AccountController extends \BaseController
|
||||
{
|
||||
@ -424,7 +424,7 @@ class AccountController extends \BaseController
|
||||
|
||||
$name = $file->getRealPath();
|
||||
|
||||
require_once app_path().'/includes/parsecsv.lib.php';
|
||||
require_once app_path().'/Includes/parsecsv.lib.php';
|
||||
$csv = new parseCSV();
|
||||
$csv->heading = false;
|
||||
$csv->auto($name);
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confide Controller Template
|
||||
@ -9,7 +9,7 @@
|
||||
|
|
||||
*/
|
||||
|
||||
use ninja\repositories\AccountRepository;
|
||||
use Ninja\Repositories\AccountRepository;
|
||||
|
||||
class AccountGatewayController extends BaseController
|
||||
{
|
||||
|
@ -1,4 +1,9 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use Auth;
|
||||
use DB;
|
||||
use Datatable;
|
||||
use Utils;
|
||||
|
||||
class ActivityController extends \BaseController
|
||||
{
|
||||
|
@ -1,7 +1,15 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use ninja\mailers\Mailer;
|
||||
use ninja\repositories\AccountRepository;
|
||||
use Artisan;
|
||||
use Cache;
|
||||
use Config;
|
||||
use DB;
|
||||
use Exception;
|
||||
use Input;
|
||||
use Utils;
|
||||
use View;
|
||||
use Ninja\Mailers\Mailer;
|
||||
use Ninja\Repositories\AccountRepository;
|
||||
|
||||
class AppController extends BaseController
|
||||
{
|
||||
@ -64,14 +72,14 @@ class AppController extends BaseController
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
|
||||
$configDir = app_path().'/config/production';
|
||||
$configDir = base_path().'/config/production';
|
||||
if (!file_exists($configDir)) {
|
||||
mkdir($configDir);
|
||||
}
|
||||
|
||||
foreach (['app' => $app, 'database' => $database, 'mail' => $mail] as $key => $config) {
|
||||
$content = '<?php return '.var_export($config, true).';';
|
||||
$fp = fopen(app_path()."/config/production/{$key}.php", 'w');
|
||||
$fp = fopen(base_path()."/config/production/{$key}.php", 'w');
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use ninja\repositories\ClientRepository;
|
||||
use Ninja\Repositories\ClientRepository;
|
||||
|
||||
class ClientApiController extends Controller
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use ninja\repositories\ClientRepository;
|
||||
use Ninja\Repositories\ClientRepository;
|
||||
|
||||
class ClientController extends \BaseController
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use ninja\repositories\CreditRepository;
|
||||
use Ninja\Repositories\CreditRepository;
|
||||
|
||||
class CreditController extends \BaseController
|
||||
{
|
||||
|
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use DB;
|
||||
|
||||
class DashboardController extends \BaseController
|
||||
{
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use App\libraries\Utils;
|
||||
use ninja\mailers\Mailer;
|
||||
use App\Libraries\Utils;
|
||||
use Ninja\Mailers\Mailer;
|
||||
use Redirect;
|
||||
|
||||
class HomeController extends BaseController
|
||||
{
|
||||
|
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use Utils;
|
||||
|
||||
class IntegrationController extends Controller
|
||||
{
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use ninja\repositories\InvoiceRepository;
|
||||
use ninja\mailers\ContactMailer as Mailer;
|
||||
use Utils;
|
||||
use Ninja\Repositories\InvoiceRepository;
|
||||
use Ninja\Mailers\ContactMailer as Mailer;
|
||||
|
||||
class InvoiceApiController extends Controller
|
||||
{
|
||||
|
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use ninja\mailers\ContactMailer as Mailer;
|
||||
use ninja\repositories\InvoiceRepository;
|
||||
use ninja\repositories\ClientRepository;
|
||||
use ninja\repositories\TaxRateRepository;
|
||||
|
||||
use Ninja\Mailers\ContactMailer as Mailer;
|
||||
use Ninja\Repositories\InvoiceRepository;
|
||||
use Ninja\Repositories\ClientRepository;
|
||||
use Ninja\Repositories\TaxRateRepository;
|
||||
|
||||
class InvoiceController extends \BaseController
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use ninja\repositories\PaymentRepository;
|
||||
use Utils;
|
||||
use Ninja\Repositories\PaymentRepository;
|
||||
|
||||
class PaymentApiController extends Controller
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use ninja\repositories\PaymentRepository;
|
||||
use ninja\repositories\InvoiceRepository;
|
||||
use ninja\repositories\AccountRepository;
|
||||
use ninja\mailers\ContactMailer;
|
||||
use Ninja\Repositories\PaymentRepository;
|
||||
use Ninja\Repositories\InvoiceRepository;
|
||||
use Ninja\Repositories\AccountRepository;
|
||||
use Ninja\Mailers\ContactMailer;
|
||||
|
||||
class PaymentController extends \BaseController
|
||||
{
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use DB;
|
||||
use Datatable;
|
||||
|
||||
class ProductController extends \BaseController
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use ninja\repositories\InvoiceRepository;
|
||||
use Utils;
|
||||
use Ninja\Repositories\InvoiceRepository;
|
||||
|
||||
class QuoteApiController extends Controller
|
||||
{
|
||||
|
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use ninja\mailers\ContactMailer as Mailer;
|
||||
use ninja\repositories\InvoiceRepository;
|
||||
use ninja\repositories\ClientRepository;
|
||||
use ninja\repositories\TaxRateRepository;
|
||||
use Utils;
|
||||
use Ninja\Mailers\ContactMailer as Mailer;
|
||||
use Ninja\Repositories\InvoiceRepository;
|
||||
use Ninja\Repositories\ClientRepository;
|
||||
use Ninja\Repositories\TaxRateRepository;
|
||||
|
||||
class QuoteController extends \BaseController
|
||||
{
|
||||
|
@ -1,4 +1,8 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use Auth;
|
||||
use Input;
|
||||
|
||||
|
||||
class ReportController extends \BaseController
|
||||
{
|
||||
|
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
|
||||
|
||||
class TimesheetController extends \BaseController {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confide Controller Template
|
||||
@ -9,7 +9,7 @@
|
||||
|
|
||||
*/
|
||||
|
||||
use ninja\repositories\AccountRepository;
|
||||
use Ninja\Repositories\AccountRepository;
|
||||
|
||||
class TokenController extends BaseController
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php namespace App\Http\Controllers;
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confide Controller Template
|
||||
@ -9,9 +9,9 @@
|
||||
|
|
||||
*/
|
||||
|
||||
use ninja\repositories\AccountRepository;
|
||||
use ninja\mailers\ContactMailer;
|
||||
use ninja\mailers\UserMailer;
|
||||
use Ninja\Repositories\AccountRepository;
|
||||
use Ninja\Mailers\ContactMailer;
|
||||
use Ninja\Mailers\UserMailer;
|
||||
|
||||
class UserController extends BaseController
|
||||
{
|
||||
|
@ -10,6 +10,7 @@ class Kernel extends HttpKernel {
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
'App\Http\Middleware\StartupCheck',
|
||||
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
|
||||
'Illuminate\Cookie\Middleware\EncryptCookies',
|
||||
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
|
||||
@ -27,6 +28,7 @@ class Kernel extends HttpKernel {
|
||||
'auth' => 'App\Http\Middleware\Authenticate',
|
||||
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
|
||||
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
|
||||
'absurd' => 'App\Http\Middleware\StartupCheck',
|
||||
];
|
||||
|
||||
}
|
||||
|
73
app/Http/Middleware/StartupCheck.php
Normal file
73
app/Http/Middleware/StartupCheck.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Utils;
|
||||
use App;
|
||||
|
||||
class StartupCheck {
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
|
||||
// Ensure all request are over HTTPS in production
|
||||
if (App::environment() == ENV_PRODUCTION)
|
||||
{
|
||||
if (!Request::secure())
|
||||
{
|
||||
return Redirect::secure(Request::getRequestUri());
|
||||
}
|
||||
}
|
||||
|
||||
// If the database doens't yet exist we'll skip the rest
|
||||
if (!Utils::isNinja() && !Utils::isDatabaseSetup())
|
||||
{
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
|
||||
// check the application is up to date and for any news feed messages
|
||||
if (Auth::check())
|
||||
{
|
||||
$count = Session::get(SESSION_COUNTER, 0);
|
||||
Session::put(SESSION_COUNTER, ++$count);
|
||||
|
||||
if (!Utils::startsWith($_SERVER['REQUEST_URI'], '/news_feed') && !Session::has('news_feed_id')) {
|
||||
$data = false;
|
||||
if (Utils::isNinja()) {
|
||||
$data = Utils::getNewsFeedResponse();
|
||||
} else {
|
||||
$file = @file_get_contents(NINJA_APP_URL . '/news_feed/' . Utils::getUserType() . '/' . NINJA_VERSION);
|
||||
$data = @json_decode($file);
|
||||
}
|
||||
if ($data) {
|
||||
if ($data->version != NINJA_VERSION) {
|
||||
$params = [
|
||||
'user_version' => NINJA_VERSION,
|
||||
'latest_version'=> $data->version,
|
||||
'releases_link' => link_to(RELEASES_URL, 'Invoice Ninja', ['target' => '_blank'])
|
||||
];
|
||||
Session::put('news_feed_id', NEW_VERSION_AVAILABLE);
|
||||
Session::put('news_feed_message', trans('texts.new_version_available', $params));
|
||||
} else {
|
||||
Session::put('news_feed_id', $data->id);
|
||||
if ($data->message && $data->id > Auth::user()->news_feed_id) {
|
||||
Session::put('news_feed_message', $data->message);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Session::put('news_feed_id', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
@ -64,7 +64,7 @@ Route::get('user/reset/{token?}', 'UserController@reset_password');
|
||||
Route::post('user/reset', 'UserController@do_reset_password');
|
||||
Route::get('logout', 'UserController@logout');
|
||||
|
||||
if (\App\libraries\Utils::isNinja()) {
|
||||
if (\App\Libraries\Utils::isNinja()) {
|
||||
Route::post('/signup/register', 'AccountController@doRegister');
|
||||
Route::get('/news_feed/{user_type}/{version}/', 'HomeController@newsFeed');
|
||||
Route::get('/demo', 'AccountController@demo');
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php namespace App\Libraries;
|
||||
|
||||
use Schema;
|
||||
use DB;
|
||||
|
||||
class Utils
|
||||
{
|
||||
@ -19,7 +21,7 @@ class Utils
|
||||
if (Schema::hasTable('accounts')) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php namespace ninja\mailers;
|
||||
<?php namespace Ninja\Mailers;
|
||||
|
||||
use Invoice;
|
||||
use Payment;
|
@ -1,4 +1,4 @@
|
||||
<?php namespace ninja\mailers;
|
||||
<?php namespace Ninja\Mailers;
|
||||
|
||||
use Mail;
|
||||
use Utils;
|
@ -1,4 +1,4 @@
|
||||
<?php namespace ninja\mailers;
|
||||
<?php namespace Ninja\Mailers;
|
||||
|
||||
use Invoice;
|
||||
use Payment;
|
@ -1,604 +0,0 @@
|
||||
<?php namespace App\libraries;
|
||||
|
||||
class Utils
|
||||
{
|
||||
public static function isRegistered()
|
||||
{
|
||||
return Auth::check() && Auth::user()->registered;
|
||||
}
|
||||
|
||||
public static function isConfirmed()
|
||||
{
|
||||
return Auth::check() && Auth::user()->confirmed;
|
||||
}
|
||||
|
||||
public static function isDatabaseSetup()
|
||||
{
|
||||
try {
|
||||
if (Schema::hasTable('accounts')) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static function isProd()
|
||||
{
|
||||
return App::environment() == ENV_PRODUCTION;
|
||||
}
|
||||
|
||||
public static function isNinja()
|
||||
{
|
||||
return self::isNinjaProd() || self::isNinjaDev();
|
||||
}
|
||||
|
||||
public static function isNinjaProd()
|
||||
{
|
||||
return isset($_ENV['NINJA_PROD']) && $_ENV['NINJA_PROD'];
|
||||
}
|
||||
|
||||
public static function isNinjaDev()
|
||||
{
|
||||
return isset($_ENV['NINJA_DEV']) && $_ENV['NINJA_DEV'];
|
||||
}
|
||||
|
||||
public static function isPro()
|
||||
{
|
||||
return Auth::check() && Auth::user()->isPro();
|
||||
}
|
||||
|
||||
public static function getUserType()
|
||||
{
|
||||
if (Utils::isNinja()) {
|
||||
return USER_TYPE_CLOUD_HOST;
|
||||
} else {
|
||||
return USER_TYPE_SELF_HOST;
|
||||
}
|
||||
}
|
||||
|
||||
public static function getDemoAccountId()
|
||||
{
|
||||
return isset($_ENV[DEMO_ACCOUNT_ID]) ? $_ENV[DEMO_ACCOUNT_ID] : false;
|
||||
}
|
||||
|
||||
public static function isDemo()
|
||||
{
|
||||
return Auth::check() && Auth::user()->isDemo();
|
||||
}
|
||||
|
||||
public static function getNewsFeedResponse($userType = false)
|
||||
{
|
||||
if (!$userType) {
|
||||
$userType = Utils::getUserType();
|
||||
}
|
||||
|
||||
$response = new stdClass();
|
||||
$response->message = isset($_ENV["{$userType}_MESSAGE"]) ? $_ENV["{$userType}_MESSAGE"] : '';
|
||||
$response->id = isset($_ENV["{$userType}_ID"]) ? $_ENV["{$userType}_ID"] : '';
|
||||
$response->version = NINJA_VERSION;
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public static function getProLabel($feature)
|
||||
{
|
||||
if (Auth::check()
|
||||
&& !Auth::user()->isPro()
|
||||
&& $feature == ACCOUNT_ADVANCED_SETTINGS) {
|
||||
return ' <sup class="pro-label">PRO</sup>';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
public static function basePath()
|
||||
{
|
||||
return substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/') + 1);
|
||||
}
|
||||
|
||||
public static function trans($input)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
foreach ($input as $field) {
|
||||
if ($field == "checkbox") {
|
||||
$data[] = $field;
|
||||
} else {
|
||||
$data[] = trans("texts.$field");
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function fatalError($message = false, $exception = false)
|
||||
{
|
||||
if (!$message) {
|
||||
$message = "An error occurred, please try again later.";
|
||||
}
|
||||
|
||||
static::logError($message.' '.$exception);
|
||||
|
||||
$data = [
|
||||
'showBreadcrumbs' => false,
|
||||
'hideHeader' => true,
|
||||
];
|
||||
|
||||
return View::make('error', $data)->with('error', $message);
|
||||
}
|
||||
|
||||
public static function getErrorString($exception)
|
||||
{
|
||||
return "{$exception->getFile()} [Line {$exception->getLine()}] => {$exception->getMessage()}";
|
||||
}
|
||||
|
||||
public static function logError($error, $context = 'PHP')
|
||||
{
|
||||
$count = Session::get('error_count', 0);
|
||||
Session::put('error_count', ++$count);
|
||||
if ($count > 100) {
|
||||
return 'logged';
|
||||
}
|
||||
|
||||
$data = [
|
||||
'context' => $context,
|
||||
'user_id' => Auth::check() ? Auth::user()->id : 0,
|
||||
'user_name' => Auth::check() ? Auth::user()->getDisplayName() : '',
|
||||
'url' => Input::get('url', Request::url()),
|
||||
'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '',
|
||||
'ip' => Request::getClientIp(),
|
||||
'count' => Session::get('error_count', 0),
|
||||
];
|
||||
|
||||
Log::error($error."\n", $data);
|
||||
|
||||
/*
|
||||
Mail::queue('emails.error', ['message'=>$error.' '.json_encode($data)], function($message)
|
||||
{
|
||||
$message->to($email)->subject($subject);
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
public static function parseFloat($value)
|
||||
{
|
||||
$value = preg_replace('/[^0-9\.\-]/', '', $value);
|
||||
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
public static function formatPhoneNumber($phoneNumber)
|
||||
{
|
||||
$phoneNumber = preg_replace('/[^0-9a-zA-Z]/', '', $phoneNumber);
|
||||
|
||||
if (!$phoneNumber) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (strlen($phoneNumber) > 10) {
|
||||
$countryCode = substr($phoneNumber, 0, strlen($phoneNumber)-10);
|
||||
$areaCode = substr($phoneNumber, -10, 3);
|
||||
$nextThree = substr($phoneNumber, -7, 3);
|
||||
$lastFour = substr($phoneNumber, -4, 4);
|
||||
|
||||
$phoneNumber = '+'.$countryCode.' ('.$areaCode.') '.$nextThree.'-'.$lastFour;
|
||||
} elseif (strlen($phoneNumber) == 10 && in_array(substr($phoneNumber, 0, 3), array(653, 656, 658, 659))) {
|
||||
/**
|
||||
* SG country code are 653, 656, 658, 659
|
||||
* US area code consist of 650, 651 and 657
|
||||
* @see http://en.wikipedia.org/wiki/Telephone_numbers_in_Singapore#Numbering_plan
|
||||
* @see http://www.bennetyee.org/ucsd-pages/area.html
|
||||
*/
|
||||
$countryCode = substr($phoneNumber, 0, 2);
|
||||
$nextFour = substr($phoneNumber, 2, 4);
|
||||
$lastFour = substr($phoneNumber, 6, 4);
|
||||
|
||||
$phoneNumber = '+'.$countryCode.' '.$nextFour.' '.$lastFour;
|
||||
} elseif (strlen($phoneNumber) == 10) {
|
||||
$areaCode = substr($phoneNumber, 0, 3);
|
||||
$nextThree = substr($phoneNumber, 3, 3);
|
||||
$lastFour = substr($phoneNumber, 6, 4);
|
||||
|
||||
$phoneNumber = '('.$areaCode.') '.$nextThree.'-'.$lastFour;
|
||||
} elseif (strlen($phoneNumber) == 7) {
|
||||
$nextThree = substr($phoneNumber, 0, 3);
|
||||
$lastFour = substr($phoneNumber, 3, 4);
|
||||
|
||||
$phoneNumber = $nextThree.'-'.$lastFour;
|
||||
}
|
||||
|
||||
return $phoneNumber;
|
||||
}
|
||||
|
||||
public static function formatMoney($value, $currencyId = false)
|
||||
{
|
||||
if (!$currencyId) {
|
||||
$currencyId = Session::get(SESSION_CURRENCY);
|
||||
}
|
||||
|
||||
$currency = Currency::remember(DEFAULT_QUERY_CACHE)->find($currencyId);
|
||||
|
||||
if (!$currency) {
|
||||
$currency = Currency::remember(DEFAULT_QUERY_CACHE)->find(1);
|
||||
}
|
||||
|
||||
return $currency->symbol.number_format($value, $currency->precision, $currency->decimal_separator, $currency->thousand_separator);
|
||||
}
|
||||
|
||||
public static function pluralize($string, $count)
|
||||
{
|
||||
$field = $count == 1 ? $string : $string.'s';
|
||||
$string = trans("texts.$field", ['count' => $count]);
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
public static function toArray($data)
|
||||
{
|
||||
return json_decode(json_encode((array) $data), true);
|
||||
}
|
||||
|
||||
public static function toSpaceCase($camelStr)
|
||||
{
|
||||
return preg_replace('/([a-z])([A-Z])/s', '$1 $2', $camelStr);
|
||||
}
|
||||
|
||||
public static function timestampToDateTimeString($timestamp)
|
||||
{
|
||||
$timezone = Session::get(SESSION_TIMEZONE, DEFAULT_TIMEZONE);
|
||||
$format = Session::get(SESSION_DATETIME_FORMAT, DEFAULT_DATETIME_FORMAT);
|
||||
|
||||
return Utils::timestampToString($timestamp, $timezone, $format);
|
||||
}
|
||||
|
||||
public static function timestampToDateString($timestamp)
|
||||
{
|
||||
$timezone = Session::get(SESSION_TIMEZONE, DEFAULT_TIMEZONE);
|
||||
$format = Session::get(SESSION_DATE_FORMAT, DEFAULT_DATE_FORMAT);
|
||||
|
||||
return Utils::timestampToString($timestamp, $timezone, $format);
|
||||
}
|
||||
|
||||
public static function dateToString($date)
|
||||
{
|
||||
$dateTime = new DateTime($date);
|
||||
$timestamp = $dateTime->getTimestamp();
|
||||
$format = Session::get(SESSION_DATE_FORMAT, DEFAULT_DATE_FORMAT);
|
||||
|
||||
return Utils::timestampToString($timestamp, false, $format);
|
||||
}
|
||||
|
||||
public static function timestampToString($timestamp, $timezone = false, $format)
|
||||
{
|
||||
if (!$timestamp) {
|
||||
return '';
|
||||
}
|
||||
$date = Carbon::createFromTimeStamp($timestamp);
|
||||
if ($timezone) {
|
||||
$date->tz = $timezone;
|
||||
}
|
||||
if ($date->year < 1900) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $date->format($format);
|
||||
}
|
||||
|
||||
public static function toSqlDate($date, $formatResult = true)
|
||||
{
|
||||
if (!$date) {
|
||||
return;
|
||||
}
|
||||
|
||||
$timezone = Session::get(SESSION_TIMEZONE);
|
||||
$format = Session::get(SESSION_DATE_FORMAT);
|
||||
|
||||
$dateTime = DateTime::createFromFormat($format, $date, new DateTimeZone($timezone));
|
||||
|
||||
return $formatResult ? $dateTime->format('Y-m-d') : $dateTime;
|
||||
}
|
||||
|
||||
public static function fromSqlDate($date, $formatResult = true)
|
||||
{
|
||||
if (!$date || $date == '0000-00-00') {
|
||||
return '';
|
||||
}
|
||||
|
||||
$timezone = Session::get(SESSION_TIMEZONE);
|
||||
$format = Session::get(SESSION_DATE_FORMAT);
|
||||
|
||||
$dateTime = DateTime::createFromFormat('Y-m-d', $date, new DateTimeZone($timezone));
|
||||
|
||||
return $formatResult ? $dateTime->format($format) : $dateTime;
|
||||
}
|
||||
|
||||
public static function today($formatResult = true)
|
||||
{
|
||||
$timezone = Session::get(SESSION_TIMEZONE);
|
||||
$format = Session::get(SESSION_DATE_FORMAT);
|
||||
$date = date_create(null, new DateTimeZone($timezone));
|
||||
|
||||
if ($formatResult) {
|
||||
return $date->format($format);
|
||||
} else {
|
||||
return $date;
|
||||
}
|
||||
}
|
||||
|
||||
public static function trackViewed($name, $type, $url = false)
|
||||
{
|
||||
if (!$url) {
|
||||
$url = Request::url();
|
||||
}
|
||||
|
||||
$viewed = Session::get(RECENTLY_VIEWED);
|
||||
|
||||
if (!$viewed) {
|
||||
$viewed = [];
|
||||
}
|
||||
|
||||
$object = new stdClass();
|
||||
$object->url = $url;
|
||||
$object->name = ucwords($type).': '.$name;
|
||||
|
||||
$data = [];
|
||||
|
||||
for ($i = 0; $i<count($viewed); $i++) {
|
||||
$item = $viewed[$i];
|
||||
|
||||
if ($object->url == $item->url || $object->name == $item->name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
array_unshift($data, $item);
|
||||
}
|
||||
|
||||
array_unshift($data, $object);
|
||||
|
||||
if (count($data) > RECENTLY_VIEWED_LIMIT) {
|
||||
array_pop($data);
|
||||
}
|
||||
|
||||
Session::put(RECENTLY_VIEWED, $data);
|
||||
}
|
||||
|
||||
public static function processVariables($str)
|
||||
{
|
||||
if (!$str) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$variables = ['MONTH', 'QUARTER', 'YEAR'];
|
||||
for ($i = 0; $i<count($variables); $i++) {
|
||||
$variable = $variables[$i];
|
||||
$regExp = '/:'.$variable.'[+-]?[\d]*/';
|
||||
preg_match_all($regExp, $str, $matches);
|
||||
$matches = $matches[0];
|
||||
if (count($matches) == 0) {
|
||||
continue;
|
||||
}
|
||||
foreach ($matches as $match) {
|
||||
$offset = 0;
|
||||
$addArray = explode('+', $match);
|
||||
$minArray = explode('-', $match);
|
||||
if (count($addArray) > 1) {
|
||||
$offset = intval($addArray[1]);
|
||||
} elseif (count($minArray) > 1) {
|
||||
$offset = intval($minArray[1]) * -1;
|
||||
}
|
||||
|
||||
$val = Utils::getDatePart($variable, $offset);
|
||||
$str = str_replace($match, $val, $str);
|
||||
}
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
private static function getDatePart($part, $offset)
|
||||
{
|
||||
$offset = intval($offset);
|
||||
if ($part == 'MONTH') {
|
||||
return Utils::getMonth($offset);
|
||||
} elseif ($part == 'QUARTER') {
|
||||
return Utils::getQuarter($offset);
|
||||
} elseif ($part == 'YEAR') {
|
||||
return Utils::getYear($offset);
|
||||
}
|
||||
}
|
||||
|
||||
private static function getMonth($offset)
|
||||
{
|
||||
$months = [ "January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December", ];
|
||||
|
||||
$month = intval(date('n')) - 1;
|
||||
|
||||
$month += $offset;
|
||||
$month = $month % 12;
|
||||
|
||||
if ($month < 0) {
|
||||
$month += 12;
|
||||
}
|
||||
|
||||
return $months[$month];
|
||||
}
|
||||
|
||||
private static function getQuarter($offset)
|
||||
{
|
||||
$month = intval(date('n')) - 1;
|
||||
$quarter = floor(($month + 3) / 3);
|
||||
$quarter += $offset;
|
||||
$quarter = $quarter % 4;
|
||||
if ($quarter == 0) {
|
||||
$quarter = 4;
|
||||
}
|
||||
|
||||
return 'Q'.$quarter;
|
||||
}
|
||||
|
||||
private static function getYear($offset)
|
||||
{
|
||||
$year = intval(date('Y'));
|
||||
|
||||
return $year + $offset;
|
||||
}
|
||||
|
||||
public static function getEntityName($entityType)
|
||||
{
|
||||
return ucwords(str_replace('_', ' ', $entityType));
|
||||
}
|
||||
|
||||
public static function getClientDisplayName($model)
|
||||
{
|
||||
if ($model->client_name) {
|
||||
return $model->client_name;
|
||||
} elseif ($model->first_name || $model->last_name) {
|
||||
return $model->first_name.' '.$model->last_name;
|
||||
} else {
|
||||
return $model->email;
|
||||
}
|
||||
}
|
||||
|
||||
public static function encodeActivity($person = null, $action, $entity = null, $otherPerson = null)
|
||||
{
|
||||
$person = $person ? $person->getDisplayName() : '<i>System</i>';
|
||||
$entity = $entity ? '['.$entity->getActivityKey().']' : '';
|
||||
$otherPerson = $otherPerson ? 'to '.$otherPerson->getDisplayName() : '';
|
||||
$token = Session::get('token_id') ? ' ('.trans('texts.token').')' : '';
|
||||
|
||||
return trim("$person $token $action $entity $otherPerson");
|
||||
}
|
||||
|
||||
public static function decodeActivity($message)
|
||||
{
|
||||
$pattern = '/\[([\w]*):([\d]*):(.*)\]/i';
|
||||
preg_match($pattern, $message, $matches);
|
||||
|
||||
if (count($matches) > 0) {
|
||||
$match = $matches[0];
|
||||
$type = $matches[1];
|
||||
$publicId = $matches[2];
|
||||
$name = $matches[3];
|
||||
|
||||
$link = link_to($type.'s/'.$publicId, $name);
|
||||
$message = str_replace($match, "$type $link", $message);
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
public static function generateLicense()
|
||||
{
|
||||
$parts = [];
|
||||
for ($i = 0; $i<5; $i++) {
|
||||
$parts[] = strtoupper(str_random(4));
|
||||
}
|
||||
|
||||
return implode('-', $parts);
|
||||
}
|
||||
|
||||
public static function lookupEventId($eventName)
|
||||
{
|
||||
if ($eventName == 'create_client') {
|
||||
return EVENT_CREATE_CLIENT;
|
||||
} elseif ($eventName == 'create_invoice') {
|
||||
return EVENT_CREATE_INVOICE;
|
||||
} elseif ($eventName == 'create_quote') {
|
||||
return EVENT_CREATE_QUOTE;
|
||||
} elseif ($eventName == 'create_payment') {
|
||||
return EVENT_CREATE_PAYMENT;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static function notifyZapier($subscription, $data)
|
||||
{
|
||||
$curl = curl_init();
|
||||
|
||||
$jsonEncodedData = json_encode($data->toJson());
|
||||
$opts = [
|
||||
CURLOPT_URL => $subscription->target_url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POST => 1,
|
||||
CURLOPT_POSTFIELDS => $jsonEncodedData,
|
||||
CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Content-Length: '.strlen($jsonEncodedData)],
|
||||
];
|
||||
|
||||
curl_setopt_array($curl, $opts);
|
||||
|
||||
$result = curl_exec($curl);
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
if ($status == 410) {
|
||||
$subscription->delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function remapPublicIds(array $data)
|
||||
{
|
||||
$return = [];
|
||||
|
||||
foreach ($data as $key => $val) {
|
||||
if ($key === 'public_id') {
|
||||
$key = 'id';
|
||||
} elseif (strpos($key, '_id')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_array($val)) {
|
||||
$val = Utils::remapPublicIds($val);
|
||||
}
|
||||
|
||||
$return[$key] = $val;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public static function getApiHeaders($count = 0)
|
||||
{
|
||||
return [
|
||||
'Content-Type' => 'application/json',
|
||||
//'Access-Control-Allow-Origin' => '*',
|
||||
//'Access-Control-Allow-Methods' => 'GET',
|
||||
//'Access-Control-Allow-Headers' => 'Origin, Content-Type, Accept, Authorization, X-Requested-With',
|
||||
//'Access-Control-Allow-Credentials' => 'true',
|
||||
'X-Total-Count' => $count,
|
||||
//'X-Rate-Limit-Limit' - The number of allowed requests in the current period
|
||||
//'X-Rate-Limit-Remaining' - The number of remaining requests in the current period
|
||||
//'X-Rate-Limit-Reset' - The number of seconds left in the current period,
|
||||
];
|
||||
}
|
||||
|
||||
public static function startsWith($haystack, $needle)
|
||||
{
|
||||
return $needle === "" || strpos($haystack, $needle) === 0;
|
||||
}
|
||||
|
||||
public static function endsWith($haystack, $needle)
|
||||
{
|
||||
return $needle === "" || substr($haystack, -strlen($needle)) === $needle;
|
||||
}
|
||||
|
||||
public static function getEntityRowClass($model)
|
||||
{
|
||||
$str = $model->is_deleted || ($model->deleted_at && $model->deleted_at != '0000-00-00') ? 'DISABLED ' : '';
|
||||
|
||||
if ($model->is_deleted) {
|
||||
$str .= 'ENTITY_DELETED ';
|
||||
}
|
||||
|
||||
if ($model->deleted_at && $model->deleted_at != '0000-00-00') {
|
||||
$str .= 'ENTITY_ARCHIVED ';
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
1
bootstrap/environment.php
Normal file
1
bootstrap/environment.php
Normal file
@ -0,0 +1 @@
|
||||
<?php return 'production';
|
@ -57,10 +57,10 @@
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"app/Console/Commands",
|
||||
"app/libraries",
|
||||
"app/Libraries",
|
||||
"app/Http/Controllers",
|
||||
"app/Models",
|
||||
"app/ninja",
|
||||
"app/Ninja",
|
||||
"vendor/calvinfroedge/PHP-Payments/lib",
|
||||
"database"
|
||||
],
|
||||
|
@ -243,32 +243,33 @@ return [
|
||||
|
||||
// Added Class Aliases
|
||||
|
||||
'Utils' => 'App\Libraries\Utils',
|
||||
'Form' => 'Illuminate\Html\FormFacade',
|
||||
'HTML' => 'Illuminate\Html\HtmlFacade',
|
||||
'SSH' => 'Illuminate\Support\Facades\SSH',
|
||||
'Alert' => 'Bootstrapper\Alert',
|
||||
'Badge' => 'Bootstrapper\Badge',
|
||||
'Breadcrumb' => 'Bootstrapper\Breadcrumb',
|
||||
'Button' => 'Bootstrapper\Button',
|
||||
'ButtonGroup' => 'Bootstrapper\ButtonGroup',
|
||||
'ButtonToolbar' => 'Bootstrapper\ButtonToolbar',
|
||||
'Carousel' => 'Bootstrapper\Carousel',
|
||||
'DropdownButton' => 'Bootstrapper\DropdownButton',
|
||||
'Form' => 'Bootstrapper\Form',
|
||||
'Helpers' => 'Bootstrapper\Helpers',
|
||||
'Icon' => 'Bootstrapper\Icon',
|
||||
//'Image' => 'Bootstrapper\Image',
|
||||
'Label' => 'Bootstrapper\Label',
|
||||
'MediaObject' => 'Bootstrapper\MediaObject',
|
||||
'Navbar' => 'Bootstrapper\Navbar',
|
||||
'Navigation' => 'Bootstrapper\Navigation',
|
||||
'Paginator' => 'Bootstrapper\Paginator',
|
||||
'Progress' => 'Bootstrapper\Progress',
|
||||
'Tabbable' => 'Bootstrapper\Tabbable',
|
||||
'Table' => 'Bootstrapper\Table',
|
||||
'Thumbnail' => 'Bootstrapper\Thumbnail',
|
||||
'Typeahead' => 'Bootstrapper\Typeahead',
|
||||
'Typography' => 'Bootstrapper\Typography',
|
||||
'Alert' => 'Bootstrapper\Facades\Alert',
|
||||
'Badge' => 'Bootstrapper\Facades\Badge',
|
||||
'Breadcrumb' => 'Bootstrapper\Facades\Breadcrumb',
|
||||
'Button' => 'Bootstrapper\Facades\Button',
|
||||
'ButtonGroup' => 'Bootstrapper\Facades\ButtonGroup',
|
||||
'ButtonToolbar' => 'Bootstrapper\Facades\ButtonToolbar',
|
||||
'Carousel' => 'Bootstrapper\Facades\Carousel',
|
||||
'DropdownButton' => 'Bootstrapper\Facades\DropdownButton',
|
||||
'Form' => 'Bootstrapper\Facades\Form',
|
||||
'Helpers' => 'Bootstrapper\Facades\Helpers',
|
||||
'Icon' => 'Bootstrapper\Facades\Icon',
|
||||
//'Image' => 'Bootstrapper\Facades\Image',
|
||||
'Label' => 'Bootstrapper\Facades\Label',
|
||||
'MediaObject' => 'Bootstrapper\Facades\MediaObject',
|
||||
'Navbar' => 'Bootstrapper\Facades\Navbar',
|
||||
'Navigation' => 'Bootstrapper\Facades\Navigation',
|
||||
'Paginator' => 'Bootstrapper\Facades\Paginator',
|
||||
'Progress' => 'Bootstrapper\Facades\Progress',
|
||||
'Tabbable' => 'Bootstrapper\Facades\Tabbable',
|
||||
'Table' => 'Bootstrapper\Facades\Table',
|
||||
'Thumbnail' => 'Bootstrapper\Facades\Thumbnail',
|
||||
'Typeahead' => 'Bootstrapper\Facades\Typeahead',
|
||||
'Typography' => 'Bootstrapper\Facades\Typography',
|
||||
'Former' => 'Former\Facades\Former',
|
||||
'Datatable' => 'Chumper\Datatable\Facades\DatatableFacade',
|
||||
'Omnipay' => 'Omnipay\Omnipay',
|
||||
|
@ -34,7 +34,7 @@ FLUSH PRIVILEGES;</pre>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{{ Former::open()->rules([
|
||||
{!! Former::open()->rules([
|
||||
'app[url]' => 'required',
|
||||
'database[type][host]' => 'required',
|
||||
'database[type][database]' => 'required',
|
||||
@ -45,14 +45,14 @@ FLUSH PRIVILEGES;</pre>
|
||||
'email' => 'required|email',
|
||||
'password' => 'required',
|
||||
'terms_checkbox' => 'required'
|
||||
]) }}
|
||||
]) !!}
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Application Settings</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{ Former::text('app[url]')->label('URL')->value(Request::root()) }}
|
||||
{!! Former::text('app[url]')->label('URL')->value(Request::root()) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -61,12 +61,12 @@ FLUSH PRIVILEGES;</pre>
|
||||
<h3 class="panel-title">Database Connection</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{ Former::select('database[default]')->label('Driver')->options(['mysql' => 'MySQL', 'pgsql' => 'PostgreSQL', 'sqlite' => 'SQLite']) }}
|
||||
{{ Former::text('database[type][host]')->label('Host')->value('localhost') }}
|
||||
{{ Former::text('database[type][database]')->label('Database')->value('ninja') }}
|
||||
{{ Former::text('database[type][username]')->label('Username')->value('ninja') }}
|
||||
{{ Former::password('database[type][password]')->label('Password')->value('ninja') }}
|
||||
{{ Former::actions( Button::normal('Test connection', ['onclick' => 'testDatabase()']), ' <span id="dbTestResult"/>' ) }}
|
||||
{!! Former::select('database[default]')->label('Driver')->options(['mysql' => 'MySQL', 'pgsql' => 'PostgreSQL', 'sqlite' => 'SQLite']) !!}
|
||||
{!! Former::text('database[type][host]')->label('Host')->value('localhost') !!}
|
||||
{!! Former::text('database[type][database]')->label('Database')->value('ninja') !!}
|
||||
{!! Former::text('database[type][username]')->label('Username')->value('ninja') !!}
|
||||
{!! Former::password('database[type][password]')->label('Password')->value('ninja') !!}
|
||||
{!! Former::actions( Button::normal('Test connection', ['onclick' => 'testDatabase()']), ' <span id="dbTestResult"/>' ) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -76,14 +76,14 @@ FLUSH PRIVILEGES;</pre>
|
||||
<h3 class="panel-title">Email Settings</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{ Former::select('mail[driver]')->label('Driver')->options(['smtp' => 'SMTP', 'mail' => 'Mail', 'sendmail' => 'Sendmail']) }}
|
||||
{{ Former::text('mail[host]')->label('Host')->value('localhost') }}
|
||||
{{ Former::text('mail[port]')->label('Port')->value('587') }}
|
||||
{{ Former::select('mail[encryption]')->label('Encryption')->options(['tls' => 'TLS', 'ssl' => 'SSL']) }}
|
||||
{{ Former::text('mail[from][name]')->label('From Name') }}
|
||||
{{ Former::text('mail[username]')->label('Email') }}
|
||||
{{ Former::password('mail[password]')->label('Password') }}
|
||||
{{ Former::actions( Button::normal('Send test email', ['onclick' => 'testMail()']), ' <span id="mailTestResult"/>' ) }}
|
||||
{!! Former::select('mail[driver]')->label('Driver')->options(['smtp' => 'SMTP', 'mail' => 'Mail', 'sendmail' => 'Sendmail']) !!}
|
||||
{!! Former::text('mail[host]')->label('Host')->value('localhost') !!}
|
||||
{!! Former::text('mail[port]')->label('Port')->value('587') !!}
|
||||
{!! Former::select('mail[encryption]')->label('Encryption')->options(['tls' => 'TLS', 'ssl' => 'SSL']) !!}
|
||||
{!! Former::text('mail[from][name]')->label('From Name') !!}
|
||||
{!! Former::text('mail[username]')->label('Email') !!}
|
||||
{!! Former::password('mail[password]')->label('Password') !!}
|
||||
{!! Former::actions( Button::normal('Send test email', ['onclick' => 'testMail()']), ' <span id="mailTestResult"/>' ) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -93,16 +93,16 @@ FLUSH PRIVILEGES;</pre>
|
||||
<h3 class="panel-title">User Details</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{ Former::text('first_name') }}
|
||||
{{ Former::text('last_name') }}
|
||||
{{ Former::text('email') }}
|
||||
{{ Former::password('password') }}
|
||||
{!! Former::text('first_name') !!}
|
||||
{!! Former::text('last_name') !!}
|
||||
{!! Former::text('email') !!}
|
||||
{!! Former::password('password') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Former::checkbox('terms_checkbox')->label(' ')->text(trans('texts.agree_to_terms', ['terms' => '<a href="'.NINJA_APP_URL.'/terms" target="_blank">'.trans('texts.terms_of_service').'</a>'])) }}
|
||||
{{ Former::actions( Button::submit_lg('Submit') ) }}
|
||||
{{ Former::close() }}
|
||||
{!! Former::checkbox('terms_checkbox')->label(' ')->text(trans('texts.agree_to_terms', ['terms' => '<a href="'.NINJA_APP_URL.'/terms" target="_blank">'.trans('texts.terms_of_service').'</a>'])) !!}
|
||||
{!! Former::actions( Button::primary('Submit')->submit() ) !!}
|
||||
{!! Former::close() !!}
|
||||
|
||||
</div>
|
||||
|
||||
|
2
storage/debugbar/.gitignore
vendored
Normal file
2
storage/debugbar/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
Loading…
x
Reference in New Issue
Block a user