The share method has been removed from the container. This was a legacy method that has not been documented in several years. If you are using this method, you should begin using the singleton method instead
Here is the laravel API documentation that shows the singleton method in laravel 4.2. I'm not sure what the package backwards compatibility is but this should be nonbreaking for 4.2 - 5.4.
laravel 5.4 removes the share method, this uses the singleton method which has been in laravel since 4.2.
Here is a snippet from the upgrade documentation;
Here is the laravel API documentation that shows the singleton method in laravel 4.2. I'm not sure what the package backwards compatibility is but this should be nonbreaking for 4.2 - 5.4.