laravel-desktop-notifier icon indicating copy to clipboard operation
laravel-desktop-notifier copied to clipboard

Usage instructions not clear

Open Echecivuole opened this issue 4 years ago • 8 comments

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!

Echecivuole avatar Oct 30 '20 13:10 Echecivuole

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.

owenvoke avatar Oct 30 '20 14:10 owenvoke

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

Echecivuole avatar Oct 30 '20 15:10 Echecivuole

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).

https://github.com/nunomaduro/laravel-desktop-notifier/blob/c0ddf9b187d18efb12869abc0e4f4e86c150e0e6/src/LaravelDesktopNotifierServiceProvider.php#L39

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

owenvoke avatar Oct 30 '20 15:10 owenvoke

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

owenvoke avatar Oct 30 '20 18:10 owenvoke

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

shailesh-ladumor avatar Feb 23 '21 14:02 shailesh-ladumor

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

owenvoke avatar Feb 23 '21 14:02 owenvoke

@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

shailesh-ladumor avatar Feb 24 '21 03:02 shailesh-ladumor

I wonder if this is related to: https://github.com/jolicode/JoliNotif/issues/70 and https://github.com/jolicode/JoliNotif/issues/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.

owenvoke avatar Feb 24 '21 09:02 owenvoke