stan updates
This commit is contained in:
@@ -3,17 +3,24 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Events\EventType;
|
use App\Events\EventType;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Laravel\Nova\Nova;
|
use Laravel\Nova\Nova;
|
||||||
|
|
||||||
class PasswordChangeController extends Controller
|
class PasswordChangeController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
/**
|
||||||
|
* Password change view
|
||||||
|
*/
|
||||||
|
public function index(): View
|
||||||
{
|
{
|
||||||
return view('auth.password-change');
|
return view('auth.password-change');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(Request $request)
|
/**
|
||||||
|
* Update password
|
||||||
|
*/
|
||||||
|
public function update(Request $request): \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
|
||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'password' => ['string', 'min:8', 'confirmed'],
|
'password' => ['string', 'min:8', 'confirmed'],
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class ProfileController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update user profile
|
* Update user profile
|
||||||
*/
|
*/
|
||||||
public function store(UpdateUserProfileRequest $request)
|
public function store(UpdateUserProfileRequest $request): JsonResponse
|
||||||
{
|
{
|
||||||
auth()->user()->update($request->validated());
|
auth()->user()->update($request->validated());
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ class Alert extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* User
|
* User
|
||||||
|
*
|
||||||
|
* @return BelongsTo<User, Alert>
|
||||||
*/
|
*/
|
||||||
public function user(): BelongsTo
|
public function user(): BelongsTo
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ class Branch extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Branches associated with user
|
* Branches associated with user
|
||||||
|
*
|
||||||
|
* @return BelongsToMany<User>
|
||||||
*/
|
*/
|
||||||
public function users(): BelongsToMany
|
public function users(): BelongsToMany
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ class CurrencyRate extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Currencies
|
* Currencies
|
||||||
|
*
|
||||||
|
* @return array<string, string>
|
||||||
*/
|
*/
|
||||||
public static function currencies(): array
|
public static function currencies(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ class CardOrder extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* User
|
* User
|
||||||
|
*
|
||||||
|
* @return BelongsTo<User, CardOrder>
|
||||||
*/
|
*/
|
||||||
public function user(): BelongsTo
|
public function user(): BelongsTo
|
||||||
{
|
{
|
||||||
@@ -72,6 +74,8 @@ class CardOrder extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Card state
|
* Card state
|
||||||
|
*
|
||||||
|
* @return BelongsTo<CardState, CardOrder>
|
||||||
*/
|
*/
|
||||||
public function cardState(): BelongsTo
|
public function cardState(): BelongsTo
|
||||||
{
|
{
|
||||||
@@ -80,6 +84,8 @@ class CardOrder extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Card type
|
* Card type
|
||||||
|
*
|
||||||
|
* @return BelongsTo<CardType, CardOrder>
|
||||||
*/
|
*/
|
||||||
public function cardType(): BelongsTo
|
public function cardType(): BelongsTo
|
||||||
{
|
{
|
||||||
@@ -88,6 +94,8 @@ class CardOrder extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Branch
|
* Branch
|
||||||
|
*
|
||||||
|
* @return BelongsTo<Branch, CardOrder>
|
||||||
*/
|
*/
|
||||||
public function branch(): BelongsTo
|
public function branch(): BelongsTo
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ class CardPin extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* User
|
* User
|
||||||
|
*
|
||||||
|
* @return BelongsTo<User, CardPin>
|
||||||
*/
|
*/
|
||||||
public function user(): BelongsTo
|
public function user(): BelongsTo
|
||||||
{
|
{
|
||||||
@@ -61,6 +63,8 @@ class CardPin extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Card type
|
* Card type
|
||||||
|
*
|
||||||
|
* @return BelongsTo<CardType, CardPin>
|
||||||
*/
|
*/
|
||||||
public function cardType(): BelongsTo
|
public function cardType(): BelongsTo
|
||||||
{
|
{
|
||||||
@@ -69,6 +73,8 @@ class CardPin extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Branch
|
* Branch
|
||||||
|
*
|
||||||
|
* @return BelongsTo<Branch, CardPin>
|
||||||
*/
|
*/
|
||||||
public function branch(): BelongsTo
|
public function branch(): BelongsTo
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,15 @@ class User extends Resource
|
|||||||
*/
|
*/
|
||||||
public function title(): string
|
public function title(): string
|
||||||
{
|
{
|
||||||
return $this->username.sprintf(' (%s)', $this->phone);
|
return $this->name.sprintf(' (%s)', $this->username);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the search result subtitle for the resource.
|
||||||
|
*/
|
||||||
|
public function subtitle(): string
|
||||||
|
{
|
||||||
|
return $this->phone ?: '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user