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

Files are not uploaded (CodeSleeve/laravel-stapler) #49

Closed
nikola166 opened this issue Jan 21, 2015 · 3 comments
Closed

Files are not uploaded (CodeSleeve/laravel-stapler) #49

nikola166 opened this issue Jan 21, 2015 · 3 comments

Comments

@nikola166
Copy link

Hi my friends. I have the same problem Files are not uploaded #10, and I do not understand how to solve it

@nikola166
Copy link
Author

I fixed it this way:
If I add a user session objects
$ user = User :: find (1);
Session :: put ('user', $ user);
all attempts to make
   static :: saved (function ($ instance) {
             foreach ($ instance-> attachedFiles as $ attachedFile) {
                 $ attachedFile-> afterSave ($ instance);
             }
         });
lead to failure. Since the function
protected static function registerModelEvent ($ event, $ callback)
{
if (isset (static :: $ dispatcher))
{
$ name = get_called_class ();

static :: $ dispatcher-> listen ("eloquent. {$ event}: {$ name}", $ callback);
}
}
check if (isset (static :: $ dispatcher)) always returns false
I just stopped to save objects to the session.

@nikola166 nikola166 reopened this Jan 22, 2015
@tabennett
Copy link
Contributor

Are you still having an issue here? I guess I'm not quite understanding what it is you're trying to do here?

@nikola166
Copy link
Author

I tried to upload a photo to the user model. When I add an instance of the model in the user session, this model did not work events such as 'saving' and 'saved'.

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