mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 05:31:24 +00:00
Reformat with pint
This commit is contained in:
@@ -80,7 +80,7 @@ class BackupsController extends ApiController
|
||||
$this->authorize('manage backups');
|
||||
|
||||
$validated = $request->validate([
|
||||
'path' => ['required', new PathToZip()],
|
||||
'path' => ['required', new PathToZip],
|
||||
]);
|
||||
|
||||
$backupDestination = BackupDestination::create(config('filesystems.default'), config('backup.backup.name'));
|
||||
|
||||
@@ -18,7 +18,7 @@ class DownloadBackupController extends ApiController
|
||||
$this->authorize('manage backups');
|
||||
|
||||
$validated = $request->validate([
|
||||
'path' => ['required', new PathToZip()],
|
||||
'path' => ['required', new PathToZip],
|
||||
]);
|
||||
|
||||
$backupDestination = BackupDestination::create(config('filesystems.default'), config('backup.backup.name'));
|
||||
|
||||
@@ -24,7 +24,7 @@ class CloneEstimateController extends Controller
|
||||
|
||||
$date = Carbon::now();
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($estimate)
|
||||
->setCompany($estimate->company_id)
|
||||
->setCustomer($estimate->customer_id)
|
||||
|
||||
@@ -42,7 +42,7 @@ class ConvertEstimateController extends Controller
|
||||
$due_date = Carbon::now()->addDays($dueDateDays)->format('Y-m-d');
|
||||
}
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($invoice)
|
||||
->setCompany($estimate->company_id)
|
||||
->setCustomer($estimate->customer_id)
|
||||
|
||||
@@ -20,7 +20,7 @@ class NextNumberController extends Controller
|
||||
{
|
||||
$key = $request->key;
|
||||
$nextNumber = null;
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setCompany($request->header('company'))
|
||||
->setCustomer($request->userId);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class CloneInvoiceController extends Controller
|
||||
|
||||
$date = Carbon::now();
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($invoice)
|
||||
->setCompany($invoice->company_id)
|
||||
->setCustomer($invoice->customer_id)
|
||||
|
||||
@@ -13,7 +13,7 @@ class AppDomainController extends Controller
|
||||
{
|
||||
Artisan::call('optimize:clear');
|
||||
|
||||
$environmentManager = new EnvironmentManager();
|
||||
$environmentManager = new EnvironmentManager;
|
||||
|
||||
$results = $environmentManager->saveDomainVariables($request);
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ class Estimate extends Model implements HasMedia
|
||||
|
||||
$estimate = self::create($data);
|
||||
$estimate->unique_hash = Hashids::connection(Estimate::class)->encode($estimate->id);
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($estimate)
|
||||
->setCompany($estimate->company_id)
|
||||
->setCustomer($estimate->customer_id)
|
||||
@@ -262,7 +262,7 @@ class Estimate extends Model implements HasMedia
|
||||
{
|
||||
$data = $request->getEstimatePayload();
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($this)
|
||||
->setCompany($this->company_id)
|
||||
->setCustomer($request->customer_id)
|
||||
|
||||
@@ -323,7 +323,7 @@ class Invoice extends Model implements HasMedia
|
||||
|
||||
$invoice = Invoice::create($data);
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($invoice)
|
||||
->setCompany($invoice->company_id)
|
||||
->setCustomer($invoice->customer_id)
|
||||
@@ -364,7 +364,7 @@ class Invoice extends Model implements HasMedia
|
||||
|
||||
public function updateInvoice($request)
|
||||
{
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($this)
|
||||
->setCompany($this->company_id)
|
||||
->setCustomer($request->customer_id)
|
||||
|
||||
@@ -163,7 +163,7 @@ class Payment extends Model implements HasMedia
|
||||
$payment = Payment::create($data);
|
||||
$payment->unique_hash = Hashids::connection(Payment::class)->encode($payment->id);
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($payment)
|
||||
->setCompany($payment->company_id)
|
||||
->setCustomer($payment->customer_id)
|
||||
@@ -215,7 +215,7 @@ class Payment extends Model implements HasMedia
|
||||
$invoice->subtractInvoicePayment($request->amount);
|
||||
}
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel($this)
|
||||
->setCompany($this->company_id)
|
||||
->setCustomer($request->customer_id)
|
||||
@@ -452,8 +452,8 @@ class Payment extends Model implements HasMedia
|
||||
{
|
||||
$invoice = Invoice::find($transaction->invoice_id);
|
||||
|
||||
$serial = (new SerialNumberFormatter())
|
||||
->setModel(new Payment())
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel(new Payment)
|
||||
->setCompany($invoice->company_id)
|
||||
->setCustomer($invoice->customer_id)
|
||||
->setNextNumbers();
|
||||
|
||||
@@ -307,9 +307,9 @@ class RecurringInvoice extends Model
|
||||
|
||||
public function createInvoice()
|
||||
{
|
||||
//get invoice_number
|
||||
$serial = (new SerialNumberFormatter())
|
||||
->setModel(new Invoice())
|
||||
// get invoice_number
|
||||
$serial = (new SerialNumberFormatter)
|
||||
->setModel(new Invoice)
|
||||
->setCompany($this->company_id)
|
||||
->setCustomer($this->customer_id)
|
||||
->setNextNumbers();
|
||||
@@ -375,7 +375,7 @@ class RecurringInvoice extends Model
|
||||
$invoice->addCustomFields($customField);
|
||||
}
|
||||
|
||||
//send automatically
|
||||
// send automatically
|
||||
if ($this->send_automatically == true) {
|
||||
$data = [
|
||||
'body' => CompanySetting::getSetting('invoice_mail_body', $this->company_id),
|
||||
|
||||
@@ -22,7 +22,7 @@ class Setting extends Model
|
||||
return;
|
||||
}
|
||||
|
||||
$set = new Setting();
|
||||
$set = new Setting;
|
||||
$set->option = $key;
|
||||
$set->value = $setting;
|
||||
$set->save();
|
||||
|
||||
@@ -40,7 +40,7 @@ class CustomerMailResetPasswordNotification extends ResetPassword
|
||||
{
|
||||
$link = url("/{$notifiable->company->slug}/customer/reset/password/".$this->token);
|
||||
|
||||
return (new MailMessage())
|
||||
return (new MailMessage)
|
||||
->subject('Reset Password Notification')
|
||||
->line('Hello! You are receiving this email because we received a password reset request for your account.')
|
||||
->action('Reset Password', $link)
|
||||
|
||||
@@ -40,7 +40,7 @@ class MailResetPasswordNotification extends ResetPassword
|
||||
{
|
||||
$link = url('/reset-password/'.$this->token);
|
||||
|
||||
return (new MailMessage())
|
||||
return (new MailMessage)
|
||||
->subject('Reset Password Notification')
|
||||
->line('Hello! You are receiving this email because we received a password reset request for your account.')
|
||||
->action('Reset Password', $link)
|
||||
|
||||
@@ -78,14 +78,14 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
public function addMenus()
|
||||
{
|
||||
//main menu
|
||||
// main menu
|
||||
\Menu::make('main_menu', function ($menu) {
|
||||
foreach (config('invoiceshelf.main_menu') as $data) {
|
||||
$this->generateMenu($menu, $data);
|
||||
}
|
||||
});
|
||||
|
||||
//setting menu
|
||||
// setting menu
|
||||
\Menu::make('setting_menu', function ($menu) {
|
||||
foreach (config('invoiceshelf.setting_menu') as $data) {
|
||||
$this->generateMenu($menu, $data);
|
||||
|
||||
@@ -36,7 +36,7 @@ class Module
|
||||
{
|
||||
static::$scripts[$name] = $path;
|
||||
|
||||
return new static();
|
||||
return new static;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ class Module
|
||||
{
|
||||
static::$styles[$name] = $path;
|
||||
|
||||
return new static();
|
||||
return new static;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -153,7 +153,7 @@ class ModuleInstaller
|
||||
File::makeDirectory($temp_extract_dir);
|
||||
}
|
||||
// Unzip the file
|
||||
$zip = new ZipArchive();
|
||||
$zip = new ZipArchive;
|
||||
|
||||
if ($zip->open($zip_file_path)) {
|
||||
$zip->extractTo($temp_extract_dir);
|
||||
|
||||
@@ -93,7 +93,7 @@ class Updater
|
||||
File::makeDirectory($temp_extract_dir);
|
||||
}
|
||||
// Unzip the file
|
||||
$zip = new ZipArchive();
|
||||
$zip = new ZipArchive;
|
||||
|
||||
if ($zip->open($zip_file_path)) {
|
||||
$zip->extractTo($temp_extract_dir);
|
||||
|
||||
@@ -111,9 +111,9 @@ trait GeneratesPdfTrait
|
||||
public function getFieldsArray()
|
||||
{
|
||||
$customer = $this->customer;
|
||||
$shippingAddress = $customer->shippingAddress ?? new Address();
|
||||
$billingAddress = $customer->billingAddress ?? new Address();
|
||||
$companyAddress = $this->company->address ?? new Address();
|
||||
$shippingAddress = $customer->shippingAddress ?? new Address;
|
||||
$billingAddress = $customer->billingAddress ?? new Address;
|
||||
$companyAddress = $this->company->address ?? new Address;
|
||||
|
||||
$fields = [
|
||||
'{SHIPPING_ADDRESS_NAME}' => $shippingAddress->name,
|
||||
|
||||
@@ -119,7 +119,7 @@ return [
|
||||
* If pdflib present in web server and auto or selected explicitly above,
|
||||
* a real license code must exist!
|
||||
*/
|
||||
//"DOMPDF_PDFLIB_LICENSE" => "your license key here",
|
||||
// "DOMPDF_PDFLIB_LICENSE" => "your license key here",
|
||||
|
||||
/**
|
||||
* html target media view which should be rendered into pdf.
|
||||
|
||||
@@ -136,7 +136,7 @@ return [
|
||||
'-m 6', // for the slowest compression method in order to get the best compression.
|
||||
'-pass 10', // for maximizing the amount of analysis pass.
|
||||
'-mt', // multithreading for some speed improvements.
|
||||
'-q 90', //quality factor that brings the least noticeable changes.
|
||||
'-q 90', // quality factor that brings the least noticeable changes.
|
||||
],
|
||||
Spatie\ImageOptimizer\Optimizers\Avifenc::class => [
|
||||
'-a cq-level=23', // constant quality level, lower values mean better quality and greater file size (0-63).
|
||||
|
||||
@@ -68,8 +68,8 @@ class EstimateFactory extends Factory
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$sequenceNumber = (new SerialNumberFormatter())
|
||||
->setModel(new Estimate())
|
||||
$sequenceNumber = (new SerialNumberFormatter)
|
||||
->setModel(new Estimate)
|
||||
->setCompany(User::find(1)->companies()->first()->id)
|
||||
->setNextNumbers();
|
||||
|
||||
|
||||
@@ -78,8 +78,8 @@ class InvoiceFactory extends Factory
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$sequenceNumber = (new SerialNumberFormatter())
|
||||
->setModel(new Invoice())
|
||||
$sequenceNumber = (new SerialNumberFormatter)
|
||||
->setModel(new Invoice)
|
||||
->setCompany(User::find(1)->companies()->first()->id)
|
||||
->setNextNumbers();
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ class PaymentFactory extends Factory
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$sequenceNumber = (new SerialNumberFormatter())
|
||||
->setModel(new Payment())
|
||||
$sequenceNumber = (new SerialNumberFormatter)
|
||||
->setModel(new Payment)
|
||||
->setCompany(User::find(1)->companies()->first()->id)
|
||||
->setNextNumbers();
|
||||
|
||||
|
||||
@@ -24,7 +24,5 @@ class AddUserIdToExpensesTable extends Migration
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
}
|
||||
public function down() {}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class() extends Migration
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
|
||||
@@ -122,7 +122,7 @@ use Illuminate\Support\Facades\Route;
|
||||
*/
|
||||
|
||||
// ping
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('ping', function () {
|
||||
return response()->json([
|
||||
@@ -140,7 +140,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::get('/app/version', AppVersionController::class);
|
||||
|
||||
// Authentication & Password Reset
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::prefix('auth')->group(function () {
|
||||
Route::post('login', [AuthController::class, 'login']);
|
||||
@@ -155,12 +155,12 @@ Route::prefix('/v1')->group(function () {
|
||||
});
|
||||
|
||||
// Countries
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/countries', CountriesController::class);
|
||||
|
||||
// Onboarding
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::middleware(['redirect-if-installed'])->prefix('installation')->group(function () {
|
||||
Route::get('/wizard-step', [OnboardingWizardController::class, 'getStep']);
|
||||
@@ -190,12 +190,12 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::middleware(['bouncer'])->group(function () {
|
||||
|
||||
// Bootstrap
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/bootstrap', BootstrapController::class);
|
||||
|
||||
// Currencies
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::prefix('/currencies')->group(function () {
|
||||
Route::get('/used', GetAllUsedCurrenciesController::class);
|
||||
@@ -204,24 +204,24 @@ Route::prefix('/v1')->group(function () {
|
||||
});
|
||||
|
||||
// Dashboard
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/dashboard', DashboardController::class);
|
||||
|
||||
// Auth check
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/auth/check', [AuthController::class, 'check']);
|
||||
|
||||
// Search users
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/search', SearchController::class);
|
||||
|
||||
Route::get('/search/user', SearchUsersController::class);
|
||||
|
||||
// MISC
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/config', ConfigController::class);
|
||||
|
||||
@@ -240,7 +240,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::get('/current-company', AdminCompanyController::class);
|
||||
|
||||
// Customers
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::post('/customers/delete', [CustomersController::class, 'delete']);
|
||||
|
||||
@@ -249,7 +249,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::resource('customers', CustomersController::class);
|
||||
|
||||
// Items
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::post('/items/delete', [ItemsController::class, 'delete']);
|
||||
|
||||
@@ -258,7 +258,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::resource('units', UnitsController::class);
|
||||
|
||||
// Invoices
|
||||
//-------------------------------------------------
|
||||
// -------------------------------------------------
|
||||
|
||||
Route::get('/invoices/{invoice}/send/preview', SendInvoicePreviewController::class);
|
||||
|
||||
@@ -275,7 +275,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::apiResource('invoices', InvoicesController::class);
|
||||
|
||||
// Recurring Invoice
|
||||
//-------------------------------------------------
|
||||
// -------------------------------------------------
|
||||
|
||||
Route::get('/recurring-invoice-frequency', RecurringInvoiceFrequencyController::class);
|
||||
|
||||
@@ -284,7 +284,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::apiResource('recurring-invoices', RecurringInvoiceController::class);
|
||||
|
||||
// Estimates
|
||||
//-------------------------------------------------
|
||||
// -------------------------------------------------
|
||||
|
||||
Route::get('/estimates/{estimate}/send/preview', SendEstimatePreviewController::class);
|
||||
|
||||
@@ -303,7 +303,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::apiResource('estimates', EstimatesController::class);
|
||||
|
||||
// Expenses
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/expenses/{expense}/show/receipt', ShowReceiptController::class);
|
||||
|
||||
@@ -316,7 +316,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::apiResource('categories', ExpenseCategoriesController::class);
|
||||
|
||||
// Payments
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/payments/{payment}/send/preview', SendPaymentPreviewController::class);
|
||||
|
||||
@@ -329,12 +329,12 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::apiResource('payment-methods', PaymentMethodsController::class);
|
||||
|
||||
// Custom fields
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::resource('custom-fields', CustomFieldsController::class);
|
||||
|
||||
// Backup & Disk
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::apiResource('backups', BackupsController::class);
|
||||
|
||||
@@ -345,7 +345,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::get('/disk/drivers', [DiskController::class, 'getDiskDrivers']);
|
||||
|
||||
// Exchange Rate
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/currencies/{currency}/exchange-rate', GetExchangeRateController::class);
|
||||
|
||||
@@ -358,7 +358,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::apiResource('exchange-rate-providers', ExchangeRateProviderController::class);
|
||||
|
||||
// Settings
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/me', [CompanyController::class, 'getUser']);
|
||||
|
||||
@@ -385,7 +385,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::get('/company/has-transactions', CompanyCurrencyCheckTransactionsController::class);
|
||||
|
||||
// Mails
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/mail/drivers', [MailConfigurationController::class, 'getMailDrivers']);
|
||||
|
||||
@@ -400,12 +400,12 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::apiResource('notes', NotesController::class);
|
||||
|
||||
// Tax Types
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::apiResource('tax-types', TaxTypesController::class);
|
||||
|
||||
// Roles
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('abilities', AbilitiesController::class);
|
||||
|
||||
@@ -413,7 +413,7 @@ Route::prefix('/v1')->group(function () {
|
||||
});
|
||||
|
||||
// Self Update
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::get('/check/update', CheckVersionController::class);
|
||||
|
||||
@@ -430,7 +430,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::post('/update/finish', FinishUpdateController::class);
|
||||
|
||||
// Companies
|
||||
//-------------------------------------------------
|
||||
// -------------------------------------------------
|
||||
|
||||
Route::post('companies', [CompaniesController::class, 'store']);
|
||||
|
||||
@@ -441,14 +441,14 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::get('companies', [CompaniesController::class, 'getUserCompanies']);
|
||||
|
||||
// Users
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::post('/users/delete', [UsersController::class, 'delete']);
|
||||
|
||||
Route::apiResource('/users', UsersController::class);
|
||||
|
||||
// Modules
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::prefix('/modules')->group(function () {
|
||||
Route::get('/', ModulesController::class);
|
||||
@@ -476,7 +476,7 @@ Route::prefix('/v1')->group(function () {
|
||||
Route::prefix('/{company:slug}/customer')->group(function () {
|
||||
|
||||
// Authentication & Password Reset
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
|
||||
Route::prefix('auth')->group(function () {
|
||||
|
||||
@@ -488,7 +488,7 @@ Route::prefix('/v1')->group(function () {
|
||||
});
|
||||
|
||||
// Invoices, Estimates, Payments and Expenses endpoints
|
||||
//-------------------------------------------------------
|
||||
// -------------------------------------------------------
|
||||
|
||||
Route::middleware(['auth:customer', 'customer-portal'])->group(function () {
|
||||
Route::get('/bootstrap', CustomerBootstrapController::class);
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
|
||||
Broadcast::channel('conversation.{cid}', function ($user, $cid) {
|
||||
return true; //(int) $user->conversation_id === (int) $cid
|
||||
return true; // (int) $user->conversation_id === (int) $cid
|
||||
});
|
||||
|
||||
Broadcast::channel('user.{uid}', function () {
|
||||
return true; //(int) $user->conversation_id === (int) $cid
|
||||
return true; // (int) $user->conversation_id === (int) $cid
|
||||
});
|
||||
|
||||
Broadcast::channel('company.{companyId}', function ($user, $companyId) {
|
||||
|
||||
@@ -51,23 +51,23 @@ Route::post('/{company:slug}/customer/logout', function () {
|
||||
Route::middleware('auth:sanctum')->prefix('reports')->group(function () {
|
||||
|
||||
// sales report by customer
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
Route::get('/sales/customers/{hash}', CustomerSalesReportController::class);
|
||||
|
||||
// sales report by items
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
Route::get('/sales/items/{hash}', ItemSalesReportController::class);
|
||||
|
||||
// report for expenses
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
Route::get('/expenses/{hash}', ExpensesReportController::class);
|
||||
|
||||
// report for tax summary
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
Route::get('/tax-summary/{hash}', TaxSummaryReportController::class);
|
||||
|
||||
// report for profit and loss
|
||||
//----------------------------------
|
||||
// ----------------------------------
|
||||
Route::get('/profit-loss/{hash}', ProfitLossReportController::class);
|
||||
|
||||
// download expense receipt
|
||||
|
||||
@@ -4,7 +4,7 @@ use App\Models\User;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
use function Pest\Laravel\{getJson};
|
||||
use function Pest\Laravel\getJson;
|
||||
|
||||
beforeEach(function () {
|
||||
Artisan::call('db:seed', ['--class' => 'DatabaseSeeder', '--force' => true]);
|
||||
|
||||
@@ -47,7 +47,7 @@ test('create estimate', function () {
|
||||
$estimate['taxes'] = [];
|
||||
array_push($estimate['taxes'], Tax::factory()->raw());
|
||||
|
||||
$request = new EstimatesRequest();
|
||||
$request = new EstimatesRequest;
|
||||
|
||||
$request->replace($estimate);
|
||||
|
||||
@@ -91,7 +91,7 @@ test('update estimate', function () {
|
||||
array_push($newEstimate['items'], $item);
|
||||
array_push($newEstimate['taxes'], Tax::factory()->raw());
|
||||
|
||||
$request = new EstimatesRequest();
|
||||
$request = new EstimatesRequest;
|
||||
|
||||
$request->replace($newEstimate);
|
||||
|
||||
@@ -135,7 +135,7 @@ test('create items', function () {
|
||||
|
||||
array_push($items, $item);
|
||||
|
||||
$request = new Request();
|
||||
$request = new Request;
|
||||
|
||||
$request->replace(['items' => $items]);
|
||||
|
||||
@@ -168,7 +168,7 @@ test('create taxes', function () {
|
||||
array_push($taxes, $tax1);
|
||||
array_push($taxes, $tax2);
|
||||
|
||||
$request = new Request();
|
||||
$request = new Request;
|
||||
|
||||
$request->replace(['taxes' => $taxes]);
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ test('create invoice', function () {
|
||||
$invoice['taxes'] = [];
|
||||
array_push($invoice['taxes'], Tax::factory()->raw());
|
||||
|
||||
$request = new InvoicesRequest();
|
||||
$request = new InvoicesRequest;
|
||||
|
||||
$request->replace($invoice);
|
||||
|
||||
@@ -111,7 +111,7 @@ test('update invoice', function () {
|
||||
array_push($newInvoice['items'], $item);
|
||||
array_push($newInvoice['taxes'], $tax);
|
||||
|
||||
$request = new InvoicesRequest();
|
||||
$request = new InvoicesRequest;
|
||||
|
||||
$request->replace($newInvoice);
|
||||
|
||||
@@ -154,7 +154,7 @@ test('create items', function () {
|
||||
|
||||
array_push($items, $item);
|
||||
|
||||
$request = new InvoicesRequest();
|
||||
$request = new InvoicesRequest;
|
||||
|
||||
$request->replace(['items' => $items]);
|
||||
|
||||
@@ -181,7 +181,7 @@ test('create taxes', function () {
|
||||
|
||||
array_push($taxes, $tax);
|
||||
|
||||
$request = new Request();
|
||||
$request = new Request;
|
||||
|
||||
$request->replace(['taxes' => $taxes]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user