mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-03 20:55:59 +00:00
notification implementation into the toaster
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Users\Models\User;
|
||||
@@ -27,7 +26,6 @@ class DemoNotificationDataCommand extends Command
|
||||
*/
|
||||
protected $description = 'Set up demo notifications data';
|
||||
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
@@ -74,7 +72,7 @@ class DemoNotificationDataCommand extends Command
|
||||
'data' => json_encode([
|
||||
'type' => 'team-invitation',
|
||||
'title' => 'New Team Invitation',
|
||||
'description' => "Jane Doe invite you to join into Team Folder.",
|
||||
'description' => 'Jane Doe invite you to join into Team Folder.',
|
||||
'action' => [
|
||||
'type' => 'invitation',
|
||||
'params' => [
|
||||
@@ -119,7 +117,7 @@ class DemoNotificationDataCommand extends Command
|
||||
'params' => [
|
||||
'route' => 'Files',
|
||||
'button' => 'Show Files',
|
||||
'id' => $fileRequestFolder->id,
|
||||
'id' => $fileRequestFolder->id,
|
||||
],
|
||||
],
|
||||
]),
|
||||
@@ -206,7 +204,7 @@ class DemoNotificationDataCommand extends Command
|
||||
// Create thumbnail only if image is larger than predefined image sizes
|
||||
if ($intervention->getWidth() > $size['size']) {
|
||||
// Generate thumbnail
|
||||
$intervention->resize($size['size'], null, fn($constraint) => $constraint->aspectRatio())->stream();
|
||||
$intervention->resize($size['size'], null, fn ($constraint) => $constraint->aspectRatio())->stream();
|
||||
|
||||
// Store thumbnail to disk
|
||||
Storage::put("files/$user->id/{$size['name']}-{$file_name}", $intervention);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
namespace App\Console;
|
||||
|
||||
use App\Console\Commands\DemoNotificationDataCommand;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use App\Console\Commands\SetupDevEnvironment;
|
||||
use App\Console\Commands\SetupProdEnvironment;
|
||||
use Support\Scheduler\Actions\ReportUsageAction;
|
||||
use App\Console\Commands\DemoNotificationDataCommand;
|
||||
use Support\Scheduler\Actions\DeleteFailedFilesAction;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
use Support\Scheduler\Actions\DeleteUnverifiedUsersAction;
|
||||
|
||||
@@ -18,7 +18,7 @@ class NotificationResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'type' => $this->type,
|
||||
'attributes' => [
|
||||
'type' => $this->data['type'],
|
||||
'category' => $this->data['category'],
|
||||
'title' => $this->data['title'],
|
||||
'description' => $this->data['description'],
|
||||
'action' => $this->data['action'] ?? null,
|
||||
|
||||
@@ -59,7 +59,7 @@ class InvitationIntoTeamFolder extends Notification implements ShouldQueue
|
||||
public function toArray(mixed $notifiable): array
|
||||
{
|
||||
return [
|
||||
'type' => 'team-invitation',
|
||||
'category' => 'team-invitation',
|
||||
'title' => 'New Team Invitation',
|
||||
'description' => "{$this->invitation->inviter->settings->name} invite you to join into Team Folder.",
|
||||
'action' => [
|
||||
|
||||
@@ -49,7 +49,7 @@ class UploadRequestFulfilledNotification extends Notification implements ShouldQ
|
||||
public function toArray(mixed $notifiable): array
|
||||
{
|
||||
return [
|
||||
'type' => 'file-request',
|
||||
'category' => 'file-request',
|
||||
'title' => 'File Request Filled',
|
||||
'description' => "Your file request for '{$this->uploadRequest->parent->name}' folder was filled successfully.",
|
||||
'action' => [
|
||||
|
||||
Reference in New Issue
Block a user