notify users

This commit is contained in:
2025-05-12 19:37:09 +05:00
parent f0a08a8042
commit 6450b683d1
4 changed files with 96 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Repos\Order\Loan;
use App\Models\Branch\Branch;
use App\Models\Order\Loan\LoanOrder;
use App\Nova\Resources\Order\Loan\LoanOrder as NovaLoanOrder;
use App\Nova\Resources\Order\Loan\LoanOrderMobile;
use App\Repos\Order\OrderRepo;
use Closure;
use Illuminate\Database\Eloquent\Model;
@@ -69,10 +70,11 @@ class LoanOrderRepo
string $message,
string $type = 'info',
string $icon = 'eye',
bool $mobile = false,
): void {
$id = $loanOrder->id;
$nova_path = config('nova.path');
$loan_order_path = NovaLoanOrder::uriKey();
$loan_order_path = $mobile ? LoanOrderMobile::uriKey() : NovaLoanOrder::uriKey();
$url = url($nova_path.'/resources/'.$loan_order_path.'/'.$id);
$request->user()->notifyNow(
@@ -89,11 +91,12 @@ class LoanOrderRepo
string $message,
string $type = 'info',
string $icon = 'eye',
bool $mobile = false
): void {
$id = $loanOrder->id;
$nova_path = config('nova.path');
$loan_order_path = NovaLoanOrder::uriKey();
$url = url($nova_path.'/resources/'.$loan_order_path.'/'.$id);
$loan_order_path = $mobile ? LoanOrderMobile::uriKey() : NovaLoanOrder::uriKey();
$url = URL::remote(url($nova_path.'/resources/'.$loan_order_path.'/'.$id));
// Get users related with branch...
$branch_users = DB::table('branch_user')->where('branch_id', $loanOrder->branch_id)->pluck('user_id');
@@ -116,7 +119,7 @@ class LoanOrderRepo
'message' => $message,
'actionText' => 'Görmek',
'actionUrl' => [
'url' => URL::remote($url),
'url' => $url,
'remote' => true,
],
'openInNewTab' => false,