Merge pull request #7870 from turbo124/v5-develop

Add Preloader stubs
This commit is contained in:
David Bomba 2022-10-12 17:05:57 +11:00 committed by GitHub
commit fe2554b9e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 254 additions and 36 deletions

View File

@ -1 +1 @@
5.5.30 5.5.31

View File

@ -437,7 +437,7 @@ class CreateTestData extends Command
'company_id' => $client->company->id, 'company_id' => $client->company->id,
]); ]);
Document::factory()->count(50)->create([ Document::factory()->count(5)->create([
'user_id' => $client->user->id, 'user_id' => $client->user->id,
'company_id' => $client->company_id, 'company_id' => $client->company_id,
'documentable_type' => Vendor::class, 'documentable_type' => Vendor::class,

View File

@ -25,9 +25,9 @@ class RecurringInvoiceToInvoiceFactory
$invoice->discount = $recurring_invoice->discount; $invoice->discount = $recurring_invoice->discount;
$invoice->is_amount_discount = $recurring_invoice->is_amount_discount; $invoice->is_amount_discount = $recurring_invoice->is_amount_discount;
$invoice->po_number = $recurring_invoice->po_number; $invoice->po_number = $recurring_invoice->po_number;
$invoice->footer = self::tranformObject($recurring_invoice->footer, $client); $invoice->footer = $recurring_invoice->footer ? self::tranformObject($recurring_invoice->footer, $client) : null;
$invoice->terms = self::tranformObject($recurring_invoice->terms, $client); $invoice->terms = $recurring_invoice->terms ? self::tranformObject($recurring_invoice->terms, $client) : null;
$invoice->public_notes = self::tranformObject($recurring_invoice->public_notes, $client); $invoice->public_notes = $recurring_invoice->public_notes ? self::tranformObject($recurring_invoice->public_notes, $client) : null;
$invoice->private_notes = $recurring_invoice->private_notes; $invoice->private_notes = $recurring_invoice->private_notes;
$invoice->is_deleted = $recurring_invoice->is_deleted; $invoice->is_deleted = $recurring_invoice->is_deleted;
$invoice->line_items = self::transformItems($recurring_invoice, $client); $invoice->line_items = self::transformItems($recurring_invoice, $client);

View File

@ -640,7 +640,14 @@ class ClientController extends BaseController
{ {
//delete all documents //delete all documents
$client->documents->each(function ($document) { $client->documents->each(function ($document) {
try{
Storage::disk(config('filesystems.default'))->delete($document->url); Storage::disk(config('filesystems.default'))->delete($document->url);
}
catch(\Exception $e){
nlog($e->getMessage());
}
}); });
//force delete the client //force delete the client

View File

@ -42,6 +42,7 @@ class CompanyGateway extends BaseModel
'require_postal_code', 'require_postal_code',
'require_client_phone', 'require_client_phone',
'require_contact_name', 'require_contact_name',
'require_contact_email',
'update_details', 'update_details',
'config', 'config',
'fees_and_limits', 'fees_and_limits',

View File

@ -288,11 +288,21 @@ class Credit extends BaseModel
return Storage::disk(config('filesystems.default'))->{$type}($file_path); return Storage::disk(config('filesystems.default'))->{$type}($file_path);
} }
try {
$file_exists = Storage::disk(config('filesystems.default'))->exists($file_path);
} catch (\Exception $e) {
nlog($e->getMessage());
}
if ($file_exists) {
return Storage::disk(config('filesystems.default'))->{$type}($file_path);
}
if (Storage::disk('public')->exists($file_path)) { if (Storage::disk('public')->exists($file_path)) {
return Storage::disk('public')->{$type}($file_path); return Storage::disk('public')->{$type}($file_path);
} }
$file_path = (new CreateEntityPdf($invitation))->handle(); $file_path = (new CreateEntityPdf($invitation))->handle();
return Storage::disk('public')->{$type}($file_path); return Storage::disk('public')->{$type}($file_path);

View File

@ -451,6 +451,17 @@ class Invoice extends BaseModel
return Storage::disk(config('filesystems.default'))->{$type}($file_path); return Storage::disk(config('filesystems.default'))->{$type}($file_path);
} }
try {
$file_exists = Storage::disk(config('filesystems.default'))->exists($file_path);
} catch (\Exception $e) {
nlog($e->getMessage());
}
if ($file_exists) {
return Storage::disk(config('filesystems.default'))->{$type}($file_path);
}
try { try {
$file_exists = Storage::disk('public')->exists($file_path); $file_exists = Storage::disk('public')->exists($file_path);
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@ -247,6 +247,16 @@ class Quote extends BaseModel
return Storage::disk(config('filesystems.default'))->{$type}($file_path); return Storage::disk(config('filesystems.default'))->{$type}($file_path);
} }
try {
$file_exists = Storage::disk(config('filesystems.default'))->exists($file_path);
} catch (\Exception $e) {
nlog($e->getMessage());
}
if ($file_exists) {
return Storage::disk(config('filesystems.default'))->{$type}($file_path);
}
if (Storage::disk('public')->exists($file_path)) { if (Storage::disk('public')->exists($file_path)) {
return Storage::disk('public')->{$type}($file_path); return Storage::disk('public')->{$type}($file_path);
} }

View File

@ -41,6 +41,8 @@ class SystemLog extends Model
const CATEGORY_SECURITY = 5; const CATEGORY_SECURITY = 5;
const CATEGORY_LOG = 6;
/* Event IDs*/ /* Event IDs*/
const EVENT_PAYMENT_RECONCILIATION_FAILURE = 10; const EVENT_PAYMENT_RECONCILIATION_FAILURE = 10;
@ -127,6 +129,8 @@ class SystemLog extends Model
const TYPE_LOGIN_FAILURE = 801; const TYPE_LOGIN_FAILURE = 801;
const TYPE_GENERIC = 900;
protected $fillable = [ protected $fillable = [
'client_id', 'client_id',
'company_id', 'company_id',

View File

@ -268,6 +268,10 @@ class InvoiceService
return $this; return $this;
} }
//12-10-2022
if($this->invoice->partial > 0 && !$this->invoice->partial_due_date)
$this->invoice->partial_due_date = Carbon::parse($this->invoice->date)->addDays($this->invoice->client->getSetting('payment_terms'));
else
$this->invoice->due_date = Carbon::parse($this->invoice->date)->addDays($this->invoice->client->getSetting('payment_terms')); $this->invoice->due_date = Carbon::parse($this->invoice->date)->addDays($this->invoice->client->getSetting('payment_terms'));
return $this; return $this;
@ -309,7 +313,7 @@ class InvoiceService
} elseif ($this->invoice->balance > 0 && $this->invoice->balance < $this->invoice->amount) { } elseif ($this->invoice->balance > 0 && $this->invoice->balance < $this->invoice->amount) {
$this->invoice->status_id = Invoice::STATUS_PARTIAL; $this->invoice->status_id = Invoice::STATUS_PARTIAL;
} }
elseif ($this->invoice->balance < 0) { elseif ($this->invoice->balance > 0) {
$this->invoice->status_id = Invoice::STATUS_SENT; $this->invoice->status_id = Invoice::STATUS_SENT;
} }

View File

@ -28,6 +28,7 @@ class UpdateReminder extends AbstractService
$this->settings = $settings; $this->settings = $settings;
} }
/* We only support setting reminders based on the due date, not the partial due date */
public function run() public function run()
{ {
if (! $this->settings) { if (! $this->settings) {

View File

@ -16,10 +16,12 @@ use App\Factory\CreditFactory;
use App\Factory\InvoiceItemFactory; use App\Factory\InvoiceItemFactory;
use App\Jobs\Ninja\TransactionLog; use App\Jobs\Ninja\TransactionLog;
use App\Jobs\Payment\EmailRefundPayment; use App\Jobs\Payment\EmailRefundPayment;
use App\Jobs\Util\SystemLogger;
use App\Models\Activity; use App\Models\Activity;
use App\Models\Credit; use App\Models\Credit;
use App\Models\Invoice; use App\Models\Invoice;
use App\Models\Payment; use App\Models\Payment;
use App\Models\SystemLog;
use App\Models\TransactionEvent; use App\Models\TransactionEvent;
use App\Repositories\ActivityRepository; use App\Repositories\ActivityRepository;
use App\Utils\Ninja; use App\Utils\Ninja;
@ -77,6 +79,8 @@ class RefundPayment
TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $this->payment->company->db); TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $this->payment->company->db);
SystemLogger::dispatch(['user' => auth()->user() ? auth()->user()->email : '', 'paymentables' => $this->payment->paymentables->makeHidden(['id','payment_id', 'paymentable_id','paymentable_type', 'deleted_at'])->toArray(), 'request' => request() ? request()->all() : []], SystemLog::CATEGORY_LOG, SystemLog::EVENT_USER, SystemLog::TYPE_GENERIC, $this->payment->client, $this->payment->company);
return $this->payment; return $this->payment;
} }

View File

@ -150,7 +150,7 @@ class HtmlEngine
$data['$number'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.invoice_number')]; $data['$number'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.invoice_number')];
$data['$invoice'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.invoice_number')]; $data['$invoice'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.invoice_number')];
$data['$number_short'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.invoice_number_short')]; $data['$number_short'] = ['value' => $this->entity->number ?: '&nbsp;', 'label' => ctrans('texts.invoice_number_short')];
$data['$entity.terms'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->terms), $this->client) ?: '', 'label' => ctrans('texts.invoice_terms')]; $data['$entity.terms'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->terms ?: ''), $this->client) ?: '', 'label' => ctrans('texts.invoice_terms')];
$data['$terms'] = &$data['$entity.terms']; $data['$terms'] = &$data['$entity.terms'];
$data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_invoice').'</a>', 'label' => ctrans('texts.view_invoice')]; $data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_invoice').'</a>', 'label' => ctrans('texts.view_invoice')];
$data['$viewLink'] = &$data['$view_link']; $data['$viewLink'] = &$data['$view_link'];
@ -185,7 +185,7 @@ class HtmlEngine
$data['$entity'] = ['value' => '', 'label' => ctrans('texts.quote')]; $data['$entity'] = ['value' => '', 'label' => ctrans('texts.quote')];
$data['$number'] = ['value' => $this->entity->number ?: '', 'label' => ctrans('texts.quote_number')]; $data['$number'] = ['value' => $this->entity->number ?: '', 'label' => ctrans('texts.quote_number')];
$data['$number_short'] = ['value' => $this->entity->number ?: '', 'label' => ctrans('texts.quote_number_short')]; $data['$number_short'] = ['value' => $this->entity->number ?: '', 'label' => ctrans('texts.quote_number_short')];
$data['$entity.terms'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->terms), $this->client) ?: '', 'label' => ctrans('texts.quote_terms')]; $data['$entity.terms'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->terms ?: ''), $this->client) ?: '', 'label' => ctrans('texts.quote_terms')];
$data['$terms'] = &$data['$entity.terms']; $data['$terms'] = &$data['$entity.terms'];
$data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_quote').'</a>', 'label' => ctrans('texts.view_quote')]; $data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_quote').'</a>', 'label' => ctrans('texts.view_quote')];
$data['$viewLink'] = &$data['$view_link']; $data['$viewLink'] = &$data['$view_link'];
@ -210,7 +210,7 @@ class HtmlEngine
$data['$entity'] = ['value' => '', 'label' => ctrans('texts.credit')]; $data['$entity'] = ['value' => '', 'label' => ctrans('texts.credit')];
$data['$number'] = ['value' => $this->entity->number ?: '', 'label' => ctrans('texts.credit_number')]; $data['$number'] = ['value' => $this->entity->number ?: '', 'label' => ctrans('texts.credit_number')];
$data['$number_short'] = ['value' => $this->entity->number ?: '', 'label' => ctrans('texts.credit_number_short')]; $data['$number_short'] = ['value' => $this->entity->number ?: '', 'label' => ctrans('texts.credit_number_short')];
$data['$entity.terms'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->terms), $this->client) ?: '', 'label' => ctrans('texts.credit_terms')]; $data['$entity.terms'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->terms ?: ''), $this->client) ?: '', 'label' => ctrans('texts.credit_terms')];
$data['$terms'] = &$data['$entity.terms']; $data['$terms'] = &$data['$entity.terms'];
$data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_credit').'</a>', 'label' => ctrans('texts.view_credit')]; $data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_credit').'</a>', 'label' => ctrans('texts.view_credit')];
$data['$viewButton'] = &$data['$view_link']; $data['$viewButton'] = &$data['$view_link'];
@ -303,7 +303,7 @@ class HtmlEngine
$data['$invoice.custom2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice2', $this->entity->custom_value2, $this->client) ?: '&nbsp;', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice2')]; $data['$invoice.custom2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice2', $this->entity->custom_value2, $this->client) ?: '&nbsp;', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice2')];
$data['$invoice.custom3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice3', $this->entity->custom_value3, $this->client) ?: '&nbsp;', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice3')]; $data['$invoice.custom3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice3', $this->entity->custom_value3, $this->client) ?: '&nbsp;', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice3')];
$data['$invoice.custom4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice4', $this->entity->custom_value4, $this->client) ?: '&nbsp;', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice4')]; $data['$invoice.custom4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice4', $this->entity->custom_value4, $this->client) ?: '&nbsp;', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice4')];
$data['$invoice.public_notes'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->public_notes), $this->client) ?: '', 'label' => ctrans('texts.public_notes')]; $data['$invoice.public_notes'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->public_notes ?: ''), $this->client) ?: '', 'label' => ctrans('texts.public_notes')];
$data['$entity.public_notes'] = &$data['$invoice.public_notes']; $data['$entity.public_notes'] = &$data['$invoice.public_notes'];
$data['$public_notes'] = &$data['$invoice.public_notes']; $data['$public_notes'] = &$data['$invoice.public_notes'];
$data['$notes'] = &$data['$public_notes']; $data['$notes'] = &$data['$public_notes'];
@ -535,7 +535,7 @@ class HtmlEngine
$data['$description'] = ['value' => '', 'label' => ctrans('texts.description')]; $data['$description'] = ['value' => '', 'label' => ctrans('texts.description')];
//$data['$entity_footer'] = ['value' => $this->client->getSetting("{$this->entity_string}_footer"), 'label' => '']; //$data['$entity_footer'] = ['value' => $this->client->getSetting("{$this->entity_string}_footer"), 'label' => ''];
$data['$entity_footer'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->footer), $this->client), 'label' => '']; $data['$entity_footer'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->footer ?: ''), $this->client), 'label' => ''];
$data['$footer'] = &$data['$entity_footer']; $data['$footer'] = &$data['$entity_footer'];
$data['$page_size'] = ['value' => $this->settings->page_size, 'label' => '']; $data['$page_size'] = ['value' => $this->settings->page_size, 'label' => ''];

View File

@ -300,10 +300,10 @@ trait MakesInvoiceValues
$data[$key][$table_type.'.notes'] = Helpers::processReservedKeywords($item->notes, $entity); $data[$key][$table_type.'.notes'] = Helpers::processReservedKeywords($item->notes, $entity);
$data[$key][$table_type.'.description'] = Helpers::processReservedKeywords($item->notes, $entity); $data[$key][$table_type.'.description'] = Helpers::processReservedKeywords($item->notes, $entity);
$data[$key][$table_type.".{$_table_type}1"] = strlen($item->custom_value1) > 1 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}1", $item->custom_value1, $entity) : ''; $data[$key][$table_type.".{$_table_type}1"] = strlen($item->custom_value1) >= 1 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}1", $item->custom_value1, $entity) : '';
$data[$key][$table_type.".{$_table_type}2"] = strlen($item->custom_value2) > 2 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}2", $item->custom_value2, $entity) : ''; $data[$key][$table_type.".{$_table_type}2"] = strlen($item->custom_value2) >= 1 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}2", $item->custom_value2, $entity) : '';
$data[$key][$table_type.".{$_table_type}3"] = strlen($item->custom_value3) > 3 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}3", $item->custom_value3, $entity) : ''; $data[$key][$table_type.".{$_table_type}3"] = strlen($item->custom_value3) >= 1 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}3", $item->custom_value3, $entity) : '';
$data[$key][$table_type.".{$_table_type}4"] = strlen($item->custom_value4) > 4 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}4", $item->custom_value4, $entity) : ''; $data[$key][$table_type.".{$_table_type}4"] = strlen($item->custom_value4) >= 1 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}4", $item->custom_value4, $entity) : '';
if ($item->quantity > 0 || $item->cost > 0) { if ($item->quantity > 0 || $item->cost > 0) {
$data[$key][$table_type.'.quantity'] = Number::formatValueNoTrailingZeroes($item->quantity, $entity_currency); $data[$key][$table_type.'.quantity'] = Number::formatValueNoTrailingZeroes($item->quantity, $entity_currency);

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.5.30', 'app_version' => '5.5.31',
'app_tag' => '5.5.30', 'app_tag' => '5.5.31',
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''), 'api_secret' => env('API_SECRET', ''),

View File

@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('documents', function (Blueprint $table) {
$table->index(['documentable_id', 'documentable_type', 'deleted_at']);
});
Schema::table('expenses', function (Blueprint $table) {
$table->index(['invoice_id', 'deleted_at']);
});
Schema::table('company_tokens', function (Blueprint $table) {
$table->dropIndex('company_tokens_token_index');
$table->index(['token','deleted_at']);
});
Schema::table('invoice_invitations', function (Blueprint $table) {
$table->dropIndex('invoice_invitations_key_index');
$table->index(['key','deleted_at']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
};

136
preload.php Normal file
View File

@ -0,0 +1,136 @@
<?php
require_once __DIR__ . '/vendor/autoload.php';
class Preloader
{
private array $ignores = [];
private static int $count = 0;
private array $paths;
private array $fileMap;
public function __construct(string ...$paths)
{
$this->paths = $paths;
// We'll use composer's classmap
// to easily find which classes to autoload,
// based on their filename
$classMap = require __DIR__ . '/vendor/composer/autoload_classmap.php';
$this->fileMap = array_flip($classMap);
}
public function paths(string ...$paths): Preloader
{
$this->paths = array_merge(
$this->paths,
$paths
);
return $this;
}
public function ignore(string ...$names): Preloader
{
$this->ignores = array_merge(
$this->ignores,
$names
);
return $this;
}
public function load(): void
{
// We'll loop over all registered paths
// and load them one by one
foreach ($this->paths as $path) {
$this->loadPath(rtrim($path, '/'));
}
$count = self::$count;
echo "[Preloader] Preloaded {$count} classes" . PHP_EOL;
}
private function loadPath(string $path): void
{
// If the current path is a directory,
// we'll load all files in it
if (is_dir($path)) {
$this->loadDir($path);
return;
}
// Otherwise we'll just load this one file
$this->loadFile($path);
}
private function loadDir(string $path): void
{
$handle = opendir($path);
// We'll loop over all files and directories
// in the current path,
// and load them one by one
while ($file = readdir($handle)) {
if (in_array($file, ['.', '..'])) {
continue;
}
$this->loadPath("{$path}/{$file}");
}
closedir($handle);
}
private function loadFile(string $path): void
{
// We resolve the classname from composer's autoload mapping
$class = $this->fileMap[$path] ?? null;
// And use it to make sure the class shouldn't be ignored
if ($this->shouldIgnore($class)) {
return;
}
// Finally we require the path,
// causing all its dependencies to be loaded as well
require_once($path);
self::$count++;
echo "[Preloader] Preloaded `{$class}`" . PHP_EOL;
}
private function shouldIgnore(?string $name): bool
{
if ($name === null) {
return true;
}
foreach ($this->ignores as $ignore) {
if (strpos($name, $ignore) === 0) {
return true;
}
}
return false;
}
}
(new Preloader())
->paths(__DIR__ . '/vendor/laravel')
->ignore(
\Illuminate\Filesystem\Cache::class,
\Illuminate\Log\LogManager::class,
\Illuminate\Http\Testing\File::class,
\Illuminate\Http\UploadedFile::class,
\Illuminate\Support\Carbon::class,
)
->load();

View File

@ -77,11 +77,6 @@
{{ ctrans('texts.name') }} {{ ctrans('texts.name') }}
</span> </span>
</th> </th>
<th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider">
<span role="button" wire:click="sortBy('type')" class="cursor-pointer">
{{ ctrans('texts.type') }}
</span>
</th>
<th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider"> <th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider">
<span role="button" wire:click="sortBy('size')" class="cursor-pointer"> <span role="button" wire:click="sortBy('size')" class="cursor-pointer">
{{ ctrans('texts.size') }} {{ ctrans('texts.size') }}
@ -102,9 +97,7 @@
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500"> <td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
{{ Illuminate\Support\Str::limit($document->name, 20) }} {{ Illuminate\Support\Str::limit($document->name, 20) }}
</td> </td>
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
{{ App\Models\Document::$types[$document->type]['mime'] }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500"> <td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
{{ $document->size / 1000 }} kB {{ $document->size / 1000 }} kB
</td> </td>

View File

@ -24,14 +24,6 @@
{{ Illuminate\Support\Str::limit($document->name, 40) }} {{ Illuminate\Support\Str::limit($document->name, 40) }}
</dd> </dd>
</div> </div>
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm leading-5 font-medium text-gray-500">
{{ ctrans('texts.type') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
{{ App\Models\Document::$types[$document->type]['mime'] }}
</dd>
</div>
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"> <div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm leading-5 font-medium text-gray-500"> <dt class="text-sm leading-5 font-medium text-gray-500">
{{ ctrans('texts.hash') }} {{ ctrans('texts.hash') }}