fix devops error

This commit is contained in:
ludo
2024-01-05 01:30:46 +01:00
parent 90b0af5b2d
commit 5144c1f7fd
128 changed files with 410 additions and 2580 deletions

View File

@@ -9,63 +9,39 @@ use Illuminate\Validation\ValidationException;
trait SendsPasswordResetEmails
{
/**
* Display the form to request a password reset link.
*
* @return \Illuminate\View\View
*/
public function broker()
{
return Password::broker();
}
public function showLinkRequestForm()
{
return view('auth.passwords.email');
}
/**
* Send a reset link to the given user.
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
*/
public function sendResetLinkEmail(Request $request)
{
$this->validateEmail($request);
// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$response = $this->broker()->sendResetLink(
$this->credentials($request)
);
return $response == Password::RESET_LINK_SENT
return $response === Password::RESET_LINK_SENT
? $this->sendResetLinkResponse($request, $response)
: $this->sendResetLinkFailedResponse($request, $response);
}
/**
* Validate the email for the given request.
*
* @return void
*/
protected function validateEmail(Request $request)
{
$request->validate(['email' => 'required|email']);
}
/**
* Get the needed authentication credentials from the request.
*
* @return array
*/
protected function credentials(Request $request)
{
return $request->only('email');
}
/**
* Get the response for a successful password reset link.
*
* @param string $response
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
*/
protected function sendResetLinkResponse(Request $request, $response)
{
return $request->wantsJson()
@@ -73,14 +49,6 @@ trait SendsPasswordResetEmails
: back()->with('status', trans($response));
}
/**
* Get the response for a failed password reset link.
*
* @param string $response
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Illuminate\Validation\ValidationException
*/
protected function sendResetLinkFailedResponse(Request $request, $response)
{
if ($request->wantsJson()) {
@@ -93,14 +61,4 @@ trait SendsPasswordResetEmails
->withInput($request->only('email'))
->withErrors(['email' => trans($response)]);
}
/**
* Get the broker to be used during password reset.
*
* @return \Illuminate\Contracts\Auth\PasswordBroker
*/
public function broker()
{
return Password::broker();
}
}

View File

@@ -20,10 +20,9 @@ trait HasComments
public function commentAsUser(?Model $user, string $comment)
{
$comment = new Comment([
'comment' => $comment,
'is_approved' => ($user instanceof Commentator) ? ! $user->needsCommentApproval($this) : false,
'is_approved' => $user instanceof Commentator ? ! $user->needsCommentApproval($this) : false,
'user_id' => is_null($user) ? null : $user->getKey(),
'commentable_id' => $this->getKey(),
'commentable_type' => get_class(),

View File

@@ -20,7 +20,7 @@ trait Imageable
{
$src = self::getThumbSrc($image, $with_undefined);
return $src ? "<img src='$src'>" : '';
return $src ? "<img src='{$src}'>" : '';
}
public static function getThumbSrc($image, $with_undefined = true)
@@ -32,7 +32,7 @@ trait Imageable
{
$src = self::getPreviewSrc($image, $with_undefined);
return $src ? "<img src='$src' class='img-fluid'>" : '';
return $src ? "<img src='{$src}' class='img-fluid'>" : '';
}
public static function getPreviewSrc($image, $with_undefined = true)
@@ -44,7 +44,7 @@ trait Imageable
{
$src = self::getNormalSrc($image, $with_undefined);
return $src ? "<img src='$src'>" : '';
return $src ? "<img src='{$src}'>" : '';
}
public static function getNormalSrc($image, $with_undefined = true)
@@ -56,7 +56,7 @@ trait Imageable
{
$src = self::getImageSrc($image, $with_undefined);
return $src ? "<img src='$src' class='img-fluid'>" : '';
return $src ? "<img src='{$src}' class='img-fluid'>" : '';
}
public static function getImageSrc($image, $with_undefined = true)