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

Announce' not found #11

Open
maryglo opened this issue Apr 5, 2018 · 3 comments
Open

Announce' not found #11

maryglo opened this issue Apr 5, 2018 · 3 comments

Comments

@maryglo
Copy link

maryglo commented Apr 5, 2018

When I tried to use
Announce::broadcast('hello', 'this is just a test', 'info', '30000', 'fade'); inside a function on my Controller, there's an error that says Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Class 'App\Http\Controllers\Announce' not found even if I already include the namespace
use LaravelHungary\Announcement;

Could you please post a semi-detailed instruction on how to use the classes included on your module?

Thank you so much.

@hocza
Copy link
Member

hocza commented Apr 5, 2018

You have to include it in the aliases (within your app.php).

'aliases' => [
    ...

    'Announce' => LaravelHungary\Announcement\Facades\Announce::class,
...
]

If you already did, you have to use Announce; before your class opener.

<?php
namespace App\Http\Controllers;

[...]
use Announce;

class HomeController [...]

Or simply just use it like: \Announce::broadcast() (but still you need it to be included in the app.php)

@maryglo
Copy link
Author

maryglo commented Apr 5, 2018

Thank you so much for the reply hocza.

I have another question, what do you think is the problem when I include {!! Announce::display() !!} on my template, an error occured, No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6379]

Thank you so much.

@hocza
Copy link
Member

hocza commented Apr 5, 2018

Oh well the package is using Redis... it is bound to redis to be more correct. :)

You should have a redis server up and running.

On macOS simply type brew install redis or on ubuntu: apt install redis

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

2 participants