mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 06:01:07 +03:30
Structor CSSD
This commit is contained in:
@@ -1,49 +1,49 @@
|
||||
<?php
|
||||
namespace App\Http\Controllers\Auth;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Transformers\Json;
|
||||
use App\User;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
use Illuminate\Http\Request;
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
use SendsPasswordResetEmails;
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
/**
|
||||
* Send a reset link to the given user.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function getResetToken(Request $request)
|
||||
{
|
||||
dd($request->all());
|
||||
$this->validate($request, ['email' => 'required|email']);
|
||||
if ($request->wantsJson()) {
|
||||
$user = User::where('email', $request->input('email'))->first();
|
||||
if (!$user) {
|
||||
return response()->json(Json::response(null, trans('passwords.user')), 400);
|
||||
}
|
||||
$token = $this->broker()->createToken($user);
|
||||
return response()->json(Json::response(['token' => $token]));
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php␍
|
||||
namespace App\Http\Controllers\Auth;␍
|
||||
use App\Http\Controllers\Controller;␍
|
||||
use App\Transformers\Json;␍
|
||||
use App\User;␍
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;␍
|
||||
use Illuminate\Http\Request;␍
|
||||
class ForgotPasswordController extends Controller␍
|
||||
{␍
|
||||
/*␍
|
||||
|--------------------------------------------------------------------------␍
|
||||
| Password Reset Controller␍
|
||||
|--------------------------------------------------------------------------␍
|
||||
|␍
|
||||
| This controller is responsible for handling password reset emails and␍
|
||||
| includes a trait which assists in sending these notifications from␍
|
||||
| your application to your users. Feel free to explore this trait.␍
|
||||
|␍
|
||||
*/␍
|
||||
use SendsPasswordResetEmails;␍
|
||||
/**␍
|
||||
* Create a new controller instance.␍
|
||||
*␍
|
||||
* @return void␍
|
||||
*/␍
|
||||
public function __construct()␍
|
||||
{␍
|
||||
$this->middleware('guest');␍
|
||||
}␍
|
||||
/**␍
|
||||
* Send a reset link to the given user.␍
|
||||
*␍
|
||||
* @param \Illuminate\Http\Request $request␍
|
||||
* @return \Illuminate\Http\Response␍
|
||||
*/␍
|
||||
public function getResetToken(Request $request)␍
|
||||
{␍
|
||||
dd($request->all());␍
|
||||
$this->validate($request, ['email' => 'required|email']);␍
|
||||
if ($request->wantsJson()) {␍
|
||||
$user = User::where('email', $request->input('email'))->first();␍
|
||||
if (!$user) {␍
|
||||
return response()->json(Json::response(null, trans('passwords.user')), 400);␍
|
||||
}␍
|
||||
$token = $this->broker()->createToken($user);␍
|
||||
return response()->json(Json::response(['token' => $token]));␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
|
||||
Reference in New Issue
Block a user