stan updates
This commit is contained in:
@@ -3,17 +3,24 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Events\EventType;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\Request;
|
||||
use Laravel\Nova\Nova;
|
||||
|
||||
class PasswordChangeController extends Controller
|
||||
{
|
||||
public function index()
|
||||
/**
|
||||
* Password change view
|
||||
*/
|
||||
public function index(): View
|
||||
{
|
||||
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([
|
||||
'password' => ['string', 'min:8', 'confirmed'],
|
||||
|
||||
@@ -23,7 +23,7 @@ class ProfileController extends Controller
|
||||
/**
|
||||
* Update user profile
|
||||
*/
|
||||
public function store(UpdateUserProfileRequest $request)
|
||||
public function store(UpdateUserProfileRequest $request): JsonResponse
|
||||
{
|
||||
auth()->user()->update($request->validated());
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ class Alert extends Model
|
||||
|
||||
/**
|
||||
* User
|
||||
*
|
||||
* @return BelongsTo<User, Alert>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -49,6 +49,8 @@ class Branch extends Model
|
||||
|
||||
/**
|
||||
* Branches associated with user
|
||||
*
|
||||
* @return BelongsToMany<User>
|
||||
*/
|
||||
public function users(): BelongsToMany
|
||||
{
|
||||
|
||||
@@ -19,6 +19,8 @@ class CurrencyRate extends Model
|
||||
|
||||
/**
|
||||
* Currencies
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function currencies(): array
|
||||
{
|
||||
|
||||
@@ -64,6 +64,8 @@ class CardOrder extends Model
|
||||
|
||||
/**
|
||||
* User
|
||||
*
|
||||
* @return BelongsTo<User, CardOrder>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -72,6 +74,8 @@ class CardOrder extends Model
|
||||
|
||||
/**
|
||||
* Card state
|
||||
*
|
||||
* @return BelongsTo<CardState, CardOrder>
|
||||
*/
|
||||
public function cardState(): BelongsTo
|
||||
{
|
||||
@@ -80,6 +84,8 @@ class CardOrder extends Model
|
||||
|
||||
/**
|
||||
* Card type
|
||||
*
|
||||
* @return BelongsTo<CardType, CardOrder>
|
||||
*/
|
||||
public function cardType(): BelongsTo
|
||||
{
|
||||
@@ -88,6 +94,8 @@ class CardOrder extends Model
|
||||
|
||||
/**
|
||||
* Branch
|
||||
*
|
||||
* @return BelongsTo<Branch, CardOrder>
|
||||
*/
|
||||
public function branch(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -53,6 +53,8 @@ class CardPin extends Model
|
||||
|
||||
/**
|
||||
* User
|
||||
*
|
||||
* @return BelongsTo<User, CardPin>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -61,6 +63,8 @@ class CardPin extends Model
|
||||
|
||||
/**
|
||||
* Card type
|
||||
*
|
||||
* @return BelongsTo<CardType, CardPin>
|
||||
*/
|
||||
public function cardType(): BelongsTo
|
||||
{
|
||||
@@ -69,6 +73,8 @@ class CardPin extends Model
|
||||
|
||||
/**
|
||||
* Branch
|
||||
*
|
||||
* @return BelongsTo<Branch, CardPin>
|
||||
*/
|
||||
public function branch(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -37,7 +37,15 @@ class User extends Resource
|
||||
*/
|
||||
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