Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Too few arguments to function... #236

Closed
xerk opened this issue Jul 20, 2023 · 1 comment
Closed

Too few arguments to function... #236

xerk opened this issue Jul 20, 2023 · 1 comment
Labels
bug Something isn't working Review Needed v5 version 5, supports both API and self hosted

Comments

@xerk
Copy link

xerk commented Jul 20, 2023

Describe the bug

Too few arguments to function App\Mail\ChangeEmailRequest::__construct(), 0 passed in D:\Laravel\grand\grandcalendar-api\vendor\qoraiche\laravel-mail-editor\src\MailEclipse.php on line 796 and exactly 2 expected

I got this error after installed the package from the old mails

Reproduction steps

Steps to reproduce the behavior:

  1. installed the app
  2. Go to http://api.grand.test/maileclipse/mailables
  3. then error fetched

Laravel Version:

9.19

"php": "^8.0.2",
"guzzlehttp/guzzle": "^7.2",
"intervention/image": "^2.7",
"laravel/framework": "^9.19",
"laravel/horizon": "^5.14",
"laravel/sanctum": "^3.2",
"laravel/telescope": "^4.13",
"laravel/tinker": "^2.7",
"league/flysystem-aws-s3-v3": "^3.0",
"paytabscom/laravel_paytabs": "^1.4",
"predis/predis": "~1.0",
"qoraiche/laravel-mail-editor": "^4.0",
"spatie/laravel-activitylog": "^4.7",

MailEclipse package version:

MailEclipse: 4.0

Screenshots (if applicable)

image

@xerk xerk added bug Something isn't working Review Needed labels Jul 20, 2023
@xerk
Copy link
Author

xerk commented Jul 21, 2023

Should I do it for alll constract

public function __construct($user = null)
{
    $this->user = $user;
}
<?php

namespace App\Mail;

use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Queue\SerializesModels;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Contracts\Queue\ShouldQueue;

class ChangeEmailRequest extends Mailable
{
    use Queueable, SerializesModels;

    public $otp;
    public $userName;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($otp = null, $userName= null)
    {
        $this->otp = $otp;
        $this->userName = $userName;
    }

    /**
     * Get the message envelope.
     *
     * @return \Illuminate\Mail\Mailables\Envelope
     */
    public function envelope()
    {
        return new Envelope(
            subject: 'Verify Change Email Request with OTP ',
        );
    }

    /**
     * Get the message content definition.
     *
     * @return \Illuminate\Mail\Mailables\Content
     */
    public function content()
    {
        return new Content(
            markdown: 'emails.users.changeEmailRequest',
            with: [
                'otp' => $this->otp,
                'userName' => $this->userName,
            ],
        );
    }

    /**
     * Get the attachments for the message.
     *
     * @return array
     */
    public function attachments()
    {
        return [];
    }
}

@Qoraiche Qoraiche added the v5 version 5, supports both API and self hosted label Aug 2, 2023
@Qoraiche Qoraiche closed this as completed Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Review Needed v5 version 5, supports both API and self hosted
Projects
None yet
Development

No branches or pull requests

2 participants