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

ErrorException Array Offset #27

Open
eiko03 opened this issue Jan 27, 2021 · 6 comments
Open

ErrorException Array Offset #27

eiko03 opened this issue Jan 27, 2021 · 6 comments

Comments

@eiko03
Copy link

eiko03 commented Jan 27, 2021

"message": "Trying to access array offset on value of type null",
"exception": "ErrorException",
"file": "D:\\WAM\\login-auth\\login-auth\\vendor\\nunomaduro\\laravel-desktop-notifier\\src\\LaravelDesktopNotifierServiceProvider.php",
"line": 40,

I have followed the readme and paste the same code as the read me. Doesn't work
@owenvoke
Copy link
Collaborator

Just for reference, what class is your command extending? This sounds like the $laravel property is not being set. Could you also confirm your framework version?

@eiko03
Copy link
Author

eiko03 commented Feb 1, 2021

"laravel/framework": "^8.12",
command is extending a custom class made only for this notify package @owenvoke

@owenvoke
Copy link
Collaborator

owenvoke commented Feb 1, 2021

Does it extend Illuminate\Console\Command in your custom class?

I'll see if I can replicate this later. 👍🏻

@eiko03
Copy link
Author

eiko03 commented Feb 1, 2021

yes i am extending this class, still error

@owenvoke
Copy link
Collaborator

owenvoke commented Feb 1, 2021

I was unable to replicate this issue with Laravel 8 and a default command that just contains:

class NotifyCommand extends Command
{
    protected $signature = 'notify';

    public function handle()
    {
        $this->notify('Hello Web Artisan', 'Love beautiful code? We do too!');
    }
}

@nunomaduro, any ideas on this? 🤔

@pboese
Copy link

pboese commented Feb 27, 2023

I ran into the same issue. The reason was I used it the __construct() method of the command instead of handle(). Move the notify() call into your handle() method and it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants