add: full multi-tenancy control

This commit is contained in:
Cauê Faleiros
2026-02-02 15:31:15 -03:00
commit c6ec92802b
1711 changed files with 258106 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace Webkul\Admin\Notifications;
use Illuminate\Mail\Mailable;
class Common extends Mailable
{
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(public $data) {}
/**
* Build the mail representation of the notification.
*/
public function build()
{
$message = $this
->to($this->data['to'])
->subject($this->data['subject'])
->view('admin::emails.common.index', [
'body' => $this->data['body'],
]);
if (isset($this->data['attachments'])) {
foreach ($this->data['attachments'] as $attachment) {
$message->attachData($attachment['content'], $attachment['name'], [
'mime' => $attachment['mime'],
]);
}
}
return $message;
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace Webkul\Admin\Notifications\User;
use Illuminate\Mail\Mailable;
class Create extends Mailable
{
/**
* @param object $user
* @return void
*/
public function __construct(public $user) {}
/**
* Build the mail representation of the notification.
*/
public function build()
{
return $this
->to($this->user->email)
->subject(trans('admin::app.emails.common.user.create-subject'))
->view('admin::emails.users.create', [
'user_name' => $this->user->name,
]);
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace Webkul\Admin\Notifications\User;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Notifications\Messages\MailMessage;
class UserResetPassword extends ResetPassword
{
/**
* Build the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable, $this->token);
}
return (new MailMessage)
->view('admin::emails.users.forget-password', [
'user_name' => $notifiable->name,
'token' => $this->token,
]);
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Webkul\Admin\Notifications\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class UserUpdatePassword extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new admin instance.
*
* @param \Webkul\User\Contracts\User $user
* @return void
*/
public function __construct(public $user) {}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name'])
->to($this->user->email, $this->user->name)
->subject(trans('shop::app.mail.update-password.subject'))
->view('shop::emails.users.update-password', ['user' => $this->user]);
}
}