mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 09:04:34 -04:00
Merge pull request #4112 from beganovich/v2-rename-download-files-to-documents
Rename "Downloads" to "Documents":
This commit is contained in:
commit
1a4d2a4460
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice Ninja (https://invoiceninja.com).
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
*
|
*
|
||||||
@ -12,124 +13,64 @@
|
|||||||
namespace App\Http\Controllers\ClientPortal;
|
namespace App\Http\Controllers\ClientPortal;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Requests\ClientPortal\StoreDocumentRequest;
|
use App\Http\Requests\ClientPortal\Documents\ShowDocumentRequest;
|
||||||
use Illuminate\Http\Request;
|
use App\Http\Requests\Document\DownloadMultipleDocumentsRequest;
|
||||||
use Illuminate\Support\Facades\Log;
|
use App\Models\Document;
|
||||||
|
use App\Utils\TempFile;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use ZipStream\Option\Archive;
|
||||||
|
use ZipStream\ZipStream;
|
||||||
|
|
||||||
class DocumentController extends Controller
|
class DocumentController extends Controller
|
||||||
{
|
{
|
||||||
|
use MakesHash;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
return render('documents.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the form for creating a new resource.
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
*/
|
||||||
public function create()
|
public function show(ShowDocumentRequest $request, Document $document)
|
||||||
{
|
{
|
||||||
//
|
return render('documents.show', [
|
||||||
|
'document' => $document,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function download(ShowDocumentRequest $request, Document $document)
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function store(StoreDocumentRequest $request)
|
|
||||||
{
|
{
|
||||||
$contact = auth()->user();
|
return Storage::disk($document->disk)->download($document->url, $document->name);
|
||||||
|
|
||||||
Storage::makeDirectory('public/'.$contact->client->client_hash, 0775);
|
|
||||||
|
|
||||||
$path = Storage::putFile('public/'.$contact->client->client_hash, $request->file('file'));
|
|
||||||
|
|
||||||
$contact = auth()->user();
|
|
||||||
$contact->avatar_size = $request->file('file')->getSize();
|
|
||||||
$contact->avatar_type = $request->file('file')->getClientOriginalExtension();
|
|
||||||
$contact->avatar = Storage::url($path);
|
|
||||||
$contact->save();
|
|
||||||
|
|
||||||
return response()->json($contact);
|
|
||||||
|
|
||||||
/*
|
|
||||||
[2019-08-07 05:50:23] local.ERROR: array (
|
|
||||||
'_token' => '7KoEVRjB2Fq8XBVFRUFbhQFjKm4rY9h0AGSlpdj3',
|
|
||||||
'is_avatar' => '1',
|
|
||||||
'q' => '/client/document',
|
|
||||||
'file' =>
|
|
||||||
Illuminate\Http\UploadedFile::__set_state(array(
|
|
||||||
'test' => false,
|
|
||||||
'originalName' => 'family.jpg',
|
|
||||||
'mimeType' => 'image/jpeg',
|
|
||||||
'error' => 0,
|
|
||||||
'hashName' => NULL,
|
|
||||||
)),
|
|
||||||
)
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function downloadMultiple(DownloadMultipleDocumentsRequest $request)
|
||||||
* Display the specified resource.
|
|
||||||
*
|
|
||||||
* @param int $id
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function show($id)
|
|
||||||
{
|
{
|
||||||
//
|
$documents = Document::whereIn('id', $this->transformKeys($request->file_hash))
|
||||||
}
|
->where('company_id', auth('contact')->user()->company->id)
|
||||||
|
->get();
|
||||||
|
|
||||||
/**
|
$documents->map(function ($document) {
|
||||||
* Show the form for editing the specified resource.
|
if (auth()->user('contact')->client->id != $document->documentable->id) {
|
||||||
*
|
abort(401);
|
||||||
* @param int $id
|
}
|
||||||
* @return \Illuminate\Http\Response
|
});
|
||||||
*/
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$options = new Archive();
|
||||||
* Update the specified resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param int $id
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function update(Request $request, $id)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$options->setSendHttpHeaders(true);
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function destroy()
|
|
||||||
{
|
|
||||||
$contact = auth()->user();
|
|
||||||
|
|
||||||
$file = basename($contact->avatar);
|
$zip = new ZipStream('files.zip', $options);
|
||||||
$image_path = 'public/'.$contact->client->client_hash.'/'.$file;
|
|
||||||
|
|
||||||
Storage::delete($image_path);
|
foreach ($documents as $document) {
|
||||||
|
$zip->addFileFromPath(basename($document->filePath()), TempFile::path($document->filePath()));
|
||||||
|
}
|
||||||
|
|
||||||
$contact->avatar = '';
|
$zip->finish();
|
||||||
$contact->avatar_type = '';
|
|
||||||
$contact->avatar_size = '';
|
|
||||||
$contact->save();
|
|
||||||
|
|
||||||
return response()->json($contact);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,76 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Invoice Ninja (https://invoiceninja.com).
|
|
||||||
*
|
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
||||||
*
|
|
||||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
||||||
*
|
|
||||||
* @license https://opensource.org/licenses/AAL
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\ClientPortal;
|
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
use App\Http\Requests\Document\DownloadMultipleDocumentsRequest;
|
|
||||||
use App\Http\Requests\Document\ShowDocumentRequest;
|
|
||||||
use App\Models\Document;
|
|
||||||
use App\Utils\TempFile;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use ZipStream\Option\Archive;
|
|
||||||
use ZipStream\ZipStream;
|
|
||||||
|
|
||||||
class DownloadController extends Controller
|
|
||||||
{
|
|
||||||
use MakesHash;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
return render('downloads.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
||||||
*/
|
|
||||||
public function show(ShowDocumentRequest $request, Document $download)
|
|
||||||
{
|
|
||||||
return render('downloads.show', [
|
|
||||||
'document' => $download,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param \App\Http\Requests\Document\ShowDocumentRequest $request
|
|
||||||
* @param \App\Models\Document $download
|
|
||||||
* @param bool $bulk
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function download(ShowDocumentRequest $request, Document $download)
|
|
||||||
{
|
|
||||||
return Storage::disk($download->disk)->download($download->url, $download->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function downloadMultiple(DownloadMultipleDocumentsRequest $request)
|
|
||||||
{
|
|
||||||
$documents = Document::whereIn('id', $this->transformKeys($request->file_hash))
|
|
||||||
->where('company_id', auth('contact')->user()->company->id)
|
|
||||||
->get();
|
|
||||||
|
|
||||||
$options = new Archive();
|
|
||||||
|
|
||||||
$options->setSendHttpHeaders(true);
|
|
||||||
|
|
||||||
$zip = new ZipStream('files.zip', $options);
|
|
||||||
|
|
||||||
foreach ($documents as $document) {
|
|
||||||
$zip->addFileFromPath(basename($document->filePath()), TempFile::path($document->filePath()));
|
|
||||||
}
|
|
||||||
|
|
||||||
$zip->finish();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
namespace App\Http\Livewire;
|
namespace App\Http\Livewire;
|
||||||
|
|
||||||
use App\Models\Document;
|
use App\Models\Document;
|
||||||
@ -7,16 +17,23 @@ use App\Utils\Traits\WithSorting;
|
|||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use Livewire\WithPagination;
|
use Livewire\WithPagination;
|
||||||
|
|
||||||
class DownloadsTable extends Component
|
class DocumentsTable extends Component
|
||||||
{
|
{
|
||||||
use WithPagination, WithSorting;
|
use WithPagination, WithSorting;
|
||||||
|
|
||||||
|
public $client;
|
||||||
|
|
||||||
public $per_page = 10;
|
public $per_page = 10;
|
||||||
|
|
||||||
public $status = [
|
public $status = [
|
||||||
'resources',
|
'resources',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function mount($client)
|
||||||
|
{
|
||||||
|
$this->client = $client;
|
||||||
|
}
|
||||||
|
|
||||||
public function statusChange($status)
|
public function statusChange($status)
|
||||||
{
|
{
|
||||||
if (in_array($status, $this->status)) {
|
if (in_array($status, $this->status)) {
|
||||||
@ -28,8 +45,7 @@ class DownloadsTable extends Component
|
|||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
// $query = auth('contact')->user()->client->documents();
|
$query = $this->client->documents();
|
||||||
$query = Document::query();
|
|
||||||
|
|
||||||
if (in_array('resources', $this->status) && ! in_array('client', $this->status)) {
|
if (in_array('resources', $this->status) && ! in_array('client', $this->status)) {
|
||||||
$query = $query->where('documentable_type', '!=', \App\Models\Client::class);
|
$query = $query->where('documentable_type', '!=', \App\Models\Client::class);
|
||||||
@ -40,12 +56,12 @@ class DownloadsTable extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
$query = $query
|
$query = $query
|
||||||
// ->where('is_public', true)
|
->where('is_public', true)
|
||||||
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
|
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
|
||||||
->paginate($this->per_page);
|
->paginate($this->per_page);
|
||||||
|
|
||||||
return render('components.livewire.downloads-table', [
|
return render('components.livewire.documents-table', [
|
||||||
'downloads' => $query,
|
'documents' => $query,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Http\Requests\ClientPortal\Documents;
|
||||||
|
|
||||||
|
use App\Models\Document;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class ShowDocumentRequest extends FormRequest
|
||||||
|
{
|
||||||
|
use MakesHash;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
return auth()->user('contact')->client->id === $this->document->documentable->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -23,7 +23,7 @@ class DownloadMultipleDocumentsRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function authorize()
|
public function authorize()
|
||||||
{
|
{
|
||||||
return auth()->user()->can('view', $this->document);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,7 +65,7 @@ class PortalComposer
|
|||||||
$data[] = ['title' => ctrans('texts.quotes'), 'url' => 'client.quotes.index', 'icon' => 'align-left'];
|
$data[] = ['title' => ctrans('texts.quotes'), 'url' => 'client.quotes.index', 'icon' => 'align-left'];
|
||||||
$data[] = ['title' => ctrans('texts.credits'), 'url' => 'client.credits.index', 'icon' => 'credit-card'];
|
$data[] = ['title' => ctrans('texts.credits'), 'url' => 'client.credits.index', 'icon' => 'credit-card'];
|
||||||
$data[] = ['title' => ctrans('texts.payment_methods'), 'url' => 'client.payment_methods.index', 'icon' => 'shield'];
|
$data[] = ['title' => ctrans('texts.payment_methods'), 'url' => 'client.payment_methods.index', 'icon' => 'shield'];
|
||||||
$data[] = ['title' => ctrans('texts.documents'), 'url' => 'client.downloads.index', 'icon' => 'download'];
|
$data[] = ['title' => ctrans('texts.documents'), 'url' => 'client.documents.index', 'icon' => 'download'];
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@ -102,8 +102,7 @@
|
|||||||
],
|
],
|
||||||
"post-autoload-dump": [
|
"post-autoload-dump": [
|
||||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
"@php artisan package:discover --ansi",
|
"@php artisan package:discover --ansi"
|
||||||
"@php artisan vendor:publish --force --tag=livewire:assets --ansi"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
2
public/vendor/livewire/livewire.js
vendored
2
public/vendor/livewire/livewire.js
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/livewire/livewire.js.map
vendored
2
public/vendor/livewire/livewire.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/livewire/manifest.json
vendored
2
public/vendor/livewire/manifest.json
vendored
@ -1 +1 @@
|
|||||||
{"/livewire.js":"/livewire.js?id=470956373e3454996f6b"}
|
{"/livewire.js":"/livewire.js?id=d7d975b5d122717a1ee0"}
|
@ -59,30 +59,30 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@forelse($downloads as $download)
|
@forelse($documents as $document)
|
||||||
<tr class="bg-white group hover:bg-gray-100">
|
<tr class="bg-white group hover:bg-gray-100">
|
||||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||||
<input type="checkbox" class="form-checkbox cursor-pointer" onchange="appendToElement('multiple-downloads', '{{ $download->hashed_id }}')" />
|
<input type="checkbox" class="form-checkbox cursor-pointer" onchange="appendToElement('multiple-downloads', '{{ $document->hashed_id }}')" />
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||||
{{ Illuminate\Support\Str::limit($download->name, 20) }}
|
{{ Illuminate\Support\Str::limit($document->name, 20) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||||
{{ ((new \ReflectionClass($download->documentable))->getShortName()) }}
|
{{ ((new \ReflectionClass($document->documentable))->getShortName()) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||||
{{ App\Models\Document::$types[$download->type]['mime'] }}
|
{{ App\Models\Document::$types[$document->type]['mime'] }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||||
{{ $download->size / 1000 }} kB
|
{{ $document->size / 1000 }} kB
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||||
<a href="{{ route('client.downloads.download', $download->hashed_id) }}" class="text-black hover:text-blue-600">
|
<a href="{{ route('client.documents.download', $document->hashed_id) }}" class="text-black hover:text-blue-600">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-download-cloud"><polyline points="8 17 12 21 16 17"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"></path></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-download-cloud"><polyline points="8 17 12 21 16 17"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"></path></svg>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||||
<a href="{{ route('client.downloads.show', $download->hashed_id) }}" class="button-link">
|
<a href="{{ route('client.documents.show', $document->hashed_id) }}" class="button-link">
|
||||||
{{ ctrans('texts.view') }}
|
{{ ctrans('texts.view') }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
@ -99,11 +99,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-center md:justify-between mt-6 mb-6">
|
<div class="flex justify-center md:justify-between mt-6 mb-6">
|
||||||
@if($downloads->total() > 0)
|
@if($documents->total() > 0)
|
||||||
<span class="text-gray-700 text-sm hidden md:block">
|
<span class="text-gray-700 text-sm hidden md:block">
|
||||||
{{ ctrans('texts.showing_x_of', ['first' => $downloads->firstItem(), 'last' => $downloads->lastItem(), 'total' => $downloads->total()]) }}
|
{{ ctrans('texts.showing_x_of', ['first' => $documents->firstItem(), 'last' => $documents->lastItem(), 'total' => $documents->total()]) }}
|
||||||
</span>
|
</span>
|
||||||
@endif
|
@endif
|
||||||
{{ $downloads->links() }}
|
{{ $documents->links() }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -10,8 +10,8 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('body')
|
@section('body')
|
||||||
<form action="{{ route('client.downloads.multiple') }}" method="post" id="multiple-downloads">
|
<form action="{{ route('client.documents.download_multiple') }}" method="post" id="multiple-downloads">
|
||||||
@csrf
|
@csrf
|
||||||
</form>
|
</form>
|
||||||
@livewire('downloads-table')
|
@livewire('documents-table', ['client' => $client])
|
||||||
@endsection
|
@endsection
|
@ -22,7 +22,7 @@
|
|||||||
</dt>
|
</dt>
|
||||||
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2 flex items-center">
|
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2 flex items-center">
|
||||||
{{ Illuminate\Support\Str::limit($document->name, 40) }}
|
{{ Illuminate\Support\Str::limit($document->name, 40) }}
|
||||||
<a href="{{ route('client.downloads.download', $document->hashed_id) }}" class="ml-2 text-black hover:text-blue-600" download>
|
<a href="{{ route('client.documents.download', $document->hashed_id) }}" class="ml-2 text-black hover:text-blue-600" download>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-download-cloud">
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-download-cloud">
|
||||||
<polyline points="8 17 12 21 16 17"></polyline>
|
<polyline points="8 17 12 21 16 17"></polyline>
|
||||||
<line x1="12" y1="12" x2="12" y2="21"></line>
|
<line x1="12" y1="12" x2="12" y2="21"></line>
|
@ -57,14 +57,12 @@ Route::group(['middleware' => ['auth:contact', 'locale'], 'prefix' => 'client',
|
|||||||
|
|
||||||
Route::resource('credits', 'ClientPortal\CreditController')->only('index', 'show');
|
Route::resource('credits', 'ClientPortal\CreditController')->only('index', 'show');
|
||||||
|
|
||||||
Route::post('document', 'ClientPortal\DocumentController@store')->name('document.store');
|
|
||||||
Route::delete('document', 'ClientPortal\DocumentController@destroy')->name('document.destroy');
|
|
||||||
|
|
||||||
Route::get('client/switch_company/{contact}', 'ClientPortal\SwitchCompanyController')->name('switch_company');
|
Route::get('client/switch_company/{contact}', 'ClientPortal\SwitchCompanyController')->name('switch_company');
|
||||||
|
|
||||||
Route::post('downloads/multiple', 'ClientPortal\DownloadController@downloadMultiple')->name('downloads.multiple');
|
Route::post('documents/download_multiple', 'ClientPortal\DocumentController@downloadMultiple')->name('documents.download_multiple');
|
||||||
Route::get('downloads/{download}/download', 'ClientPortal\DownloadController@download')->name('downloads.download');
|
Route::get('documents/{document}/download', 'ClientPortal\DocumentController@download')->name('documents.download');
|
||||||
Route::resource('downloads', 'ClientPortal\DownloadController')->only(['index', 'show']);
|
Route::resource('documents', 'ClientPortal\DocumentController')->only(['index', 'show']);
|
||||||
|
|
||||||
Route::post('upload', 'ClientPortal\UploadController')->name('upload.store');
|
Route::post('upload', 'ClientPortal\UploadController')->name('upload.store');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user