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

eloquent model observer #57

Open
kak2z7702 opened this issue Feb 26, 2019 · 2 comments
Open

eloquent model observer #57

kak2z7702 opened this issue Feb 26, 2019 · 2 comments
Assignees

Comments

@kak2z7702
Copy link

kak2z7702 commented Feb 26, 2019

Hello)) help me please))
i use Redis Symfony\Component\Cache\Adapter\RedisAdapter
i added in dependencies.php

$container['cache'] = function ($c) {
    $config = [
        'schema' => 'tcp',
        'host' => 'localhost',
        'port' => 6379,
            // other options
    ];
    $connection = new Predis\Client($config);
    return new Symfony\Component\Cache\Adapter\RedisAdapter($connection);
};

next
i added in dependencies.php

Dappur\Model\Room::observe(new Dappur\Model\Observers\RoomObserver($container));
Dappur\Model\RoomVideo::observe(new Dappur\Model\Observers\RoomVideoObserver($container));
Dappur\Model\RoomUser::observe(new Dappur\Model\Observers\RoomUserObserver($container));

i want use Redis in the Observer events

and i have

Line: 918

Message: Target [Interop\Container\ContainerInterface] is not instantiable while building [Dappur\Model\Observers\RoomUserObserver].

what i do no right? thank you

@kak2z7702
Copy link
Author

kak2z7702 commented Feb 27, 2019

i have new error))

Message: Unresolvable dependency resolving [Parameter #0 [ <required> $container ]] in class Dappur\Model\Observers\RoomUserObserver

I do as here https://stackoverflow.com/questions/51506326/is-it-possible-to-use-php-di-definitions-instead-of-eloquents-capsule-managers-b

@edwardteach42
Copy link
Member

I haven't messed with observers yet, but now that I am back, I will look into it as active development for v4.1

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

No branches or pull requests

2 participants