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

Usage instructions not clear #22

Open
Echecivuole opened this issue Oct 30, 2020 · 8 comments
Open

Usage instructions not clear #22

Echecivuole opened this issue Oct 30, 2020 · 8 comments

Comments

@Echecivuole
Copy link

Hello!
Very nice package, but can you better explain in step by step what to do after package is installed? Tutorial with commands and files to be edited will help many developers.
thanks!

@owenvoke
Copy link
Collaborator

owenvoke commented Oct 30, 2020

Hmm. I think it's quite clear from the example
This package just adds a $this->notify() method to commands, which is demonstrated in the README. Any specific changes you'd like to have?

I guess perhaps a sentence about the $this->notify() command being added might help, and which parameters are available.

@Echecivuole
Copy link
Author

Sorry but I am not big expert in Controller.
What to do if I want to run the notification into the homepage, through the HomeController?
do you have to add any use Notifications/ in the controller file?
if I just add $this->notify() code into home function I get error for not defined nofity

thanks

@owenvoke
Copy link
Collaborator

You can't use it in a controller, as it's a command macro. 👍🏻 Also, it wouldn't work in a web route as it's designed for command-line usage (in Artisan).

Command::macro('notify', function (string $text, string $body, $icon = null) {

Thanks, I'll update the docs with a better section on usage.

@owenvoke
Copy link
Collaborator

I've updated the docs as part of v2.5.1, does that make it clearer?

@shailesh-ladumor
Copy link

shailesh-ladumor commented Feb 23, 2021

I install this package and created one command.
here is my command

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class Notifying extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'notify:test';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $this->notify('Hello Web Artisan', 'Love beautiful code? We do too!');
    }
}

I try to fire command from a terminal. command run successfully but notification is not getting.

Please help if any thing is wrong

@owenvoke
Copy link
Collaborator

@shailesh-ladumor, just to check, what OS are you using?

@shailesh-ladumor
Copy link

shailesh-ladumor commented Feb 24, 2021

@shailesh-ladumor, just to check, what OS are you using?

OS: Window10

PHP 7.4.9 (cli)

composer

 "require": {
        "php": "^7.2.5|^8.0",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^6.3.1|^7.0.1",
        "lab404/laravel-impersonate": "^1.7",
        "laravel/framework": "^7.29",
        "laravel/tinker": "^2.5",
        "laravel/ui": "^2.4",
        "nunomaduro/laravel-desktop-notifier": "^2.5"
    },

does this help? @owenvoke

@owenvoke
Copy link
Collaborator

I wonder if this is related to: jolicode/JoliNotif#70 and jolicode/JoliNotif#45.

IIRC, Toaster doesn't really work on Windows 10, so I was working on a Snoretoast adapter but not much has been done with it.

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