jeremihza's avatar

getting error message under the image file when uploading image

inserted $app->bind('path.public', function() { return DIR; }); in my index file but no change

0 likes
3 replies
bobbybouwmann's avatar

You shouldn't do this in the index.php. Instead you need to do this in a ServiceProvider. So Laravel comes by default with the AppServiceProvider. You can add it in there

class AppServiceProvider extends ServiceProvider 
{
    public function register()
    {
        $this->app->bind('path.public', function() {
            return DIR;
        });
    }
}
1 like
Snapey's avatar

can you actually explain the issue?

How is the app->bind relevant

Please or to participate in this conversation.