Questions tagged [laravel-events]

Laravel's events provides a simple observer implementation, allowing you to subscribe and listen for events in your application.

Laravel's events provides a simple observer implementation, allowing you to subscribe and listen for events in your application.

Event classes are typically stored in the app/Events directory, while their listeners are stored in app/Listeners.

114 questions
0
votes
1 answer

Capturing rows affected by query with Event

I am trying to write an event that will display how many rows were affected by a query. I found the Illuminate\Database\Events\QueryExecuted Event. I have added a listener for the event and registered it in Event service…
Programatt
  • 786
  • 4
  • 11
  • 23
0
votes
1 answer

Adding an event listener in Laravel 5.4 is giving me a 500 error

So was trying to build in a notification when a new API token was created it would notify me. I added in the events and listeners it said too in the documentation but it is giving me a 500 error now when i try to create a new token. When I comment…
Citti
  • 423
  • 1
  • 6
  • 23
0
votes
1 answer

Redirect is not working in LogSuccessfulLogin handle in Laravel Auth

I am using Laravel 5.3 in which using Authfor user controller. So basically i create a Listener for Auth Event 'Illuminate\Auth\Events\Login' => [ 'App\Listeners\LogSuccessfulLogin', ], and in LogSuccessfulLogin handle() function redirecting…
0
votes
1 answer

Laravel 5.3 not sending Events to pusher

I'm using laravel 5.3 for my website. I needed to add real time functionality to my app so I used pusher. but the problem is when the event has been triggered nothing happened and no events sent to pusher. my pusher configuration in broadcasting.php…
0
votes
1 answer

Socket.io: Is it possible for a user to alter the listening channel?

So I'm starting to use Redis and Socket.io to broadcast events to the client side. I'm using Laravel for the backend and will take advantage of their event functionality. Based on a user's access level, I only want them to listen to certain…
kenshin9
  • 2,215
  • 4
  • 23
  • 38
0
votes
2 answers

Listen laravel 'illuminate.query' events in artisan console commands

I would like to log laravel queries. I know that we can listen to laravel queries using the following code: Event::listen('illuminate.query', function ($query, $bindings, $time, $name) { // Log queries }; I would like to place above code in an…
Rash
  • 7,677
  • 1
  • 53
  • 74
0
votes
1 answer

Laravel, Should Events talk to Database?

I'm working on a pretty simple site for photo galleries, users have the ability to vote on their favorite photo in gallery. I have some events setup each time a user votes, a VoteCase event is called, which receives the vote object. The VOTE object…
dangel
  • 7,238
  • 7
  • 48
  • 74
-1
votes
1 answer

How to reduce the code from policy file in laravel?

I have two files userPolicy.php and userObserver.php , i write some logic inside both files what it does means if a user have any active subscriptions that user won't be deleted upto this it's working fine . userPolicy.php public function…
Code cracker
  • 316
  • 1
  • 5
  • 20
-1
votes
2 answers

Undefined property: App\Events\UserWalletNewTransaction::$user_id

I have created an Event called UserWalletNewTransaction.php and added this to it: public $transaction; public function __construct($transaction) { $this->$transaction = $transaction; } And also registered it at EventServiceProivder.php: use…
user16333885
1 2 3 4 5 6 7
8