Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too few arguments to function... #236

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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