bradcornford / Googlmapper

An easy way to integrate Google Maps with Laravel
MIT License
464 stars 142 forks source link

Laravel 4 install not working #7

Closed SamBrownHTA closed 9 years ago

SamBrownHTA commented 9 years ago

I added the lines to my composer.json and app.php, but when I send the command 'php artisan config:publish cornford/googlemapper' I receive an error:

[InvalidArgumentException] Configuration not found. config:publish [--path[="..."]] [--force] package

It still created the folder in my vendor folder, but not my config/packages folder when I updated composer.

I received the error message: 'Class 'Cornford\Googlmapper\Facades\Mapper' not found' when trying to use it anyway.

bradcornford commented 9 years ago

Hi there,

Can you confirm that you have done a 'composer update' and a 'composer dump-autoload -o' prior to adding the relevant app.php change and publishing configuration? Also what version of Laravel are you using? I have just setup a clean install of 4.2 and have now issues.

SamBrownHTA commented 9 years ago

I had run the composer update and the dump-autoload, but not the with -o. What does this signify?

The relevant code for the app.php and publishing config was added.

I'm using laravel 4

Thanks, Sam

From: Bradley Cornford [mailto:notifications@github.com] Sent: 03 August 2015 18:21 To: bradcornford/Googlmapper Cc: Samantha Brown Subject: Re: [Googlmapper] Laravel 4 install not working (#7)

Hi there,

Can you confirm that you have done a 'composer update' and a 'composer dump-autoload -o' prior to adding the relevant app.php change and publishing configuration?

— Reply to this email directly or view it on GitHubhttps://github.com/bradcornford/Googlmapper/issues/7#issuecomment-127336252.

bradcornford commented 9 years ago

The '-o' signifies optimisation of the autoloader. It doesn't affect usage, but I tend to use it out of habit.

Laravel 4.0? 4.1? 4.2?

SamBrownHTA commented 9 years ago

Laravel 4.2

From: Bradley Cornford [mailto:notifications@github.com] Sent: 04 August 2015 09:14 To: bradcornford/Googlmapper Cc: Samantha Brown Subject: Re: [Googlmapper] Laravel 4 install not working (#7)

The '-o' signifies optimisation of the autoloader. It doesn't affect usage, but I tend to use it out of habit.

Laravel 4.0? 4.1? 4.2?

— Reply to this email directly or view it on GitHubhttps://github.com/bradcornford/Googlmapper/issues/7#issuecomment-127516540.

bradcornford commented 9 years ago

Could you send me over you composer.json, and your app.php config files please.

SamBrownHTA commented 9 years ago

Composer:

{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "laravel/framework": "4.2.", "intervention/image": "~2.0", "mitchellvanw/laravel-doctrine": "0.5.", "laracasts/utilities": "~1.0", "ivancevich/analytics": "dev-master", "philo/laravel-twitter": "dev-master", "riari/laravel-forum": "~1.0", "cornford/googlmapper": "1.*"

            },
            "autoload": {
                            "classmap": [
                                            "app/commands",
                                            "app/controllers",
                                            "app/models",
                                            "app/database/migrations",
                                            "app/database/seeds",
                                            "app/tests/TestCase.php"
                            ]
            },
            "scripts": {
                            "post-install-cmd": [
                                            "php artisan clear-compiled",
                                            "php artisan optimize"
                            ],
                            "post-update-cmd": [
                                            "php artisan clear-compiled",
                                            "php artisan optimize"
                            ],
                            "post-create-project-cmd": [
                                            "php artisan key:generate"
                            ]
            },
            "config": {
                            "preferred-install": "dist"
            },
            "minimum-stability": "dev"

}

app.php:

            'providers' => array(

                            'Illuminate\Foundation\Providers\ArtisanServiceProvider',
                            'Illuminate\Auth\AuthServiceProvider',
                            'Illuminate\Cache\CacheServiceProvider',
                            'Illuminate\Session\CommandsServiceProvider',
                            'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
                            'Illuminate\Routing\ControllerServiceProvider',
                            'Illuminate\Cookie\CookieServiceProvider',
                            'Illuminate\Database\DatabaseServiceProvider',
                            'Illuminate\Encryption\EncryptionServiceProvider',
                            'Illuminate\Filesystem\FilesystemServiceProvider',
                            'Illuminate\Hashing\HashServiceProvider',
                            'Illuminate\Html\HtmlServiceProvider',
                            'Illuminate\Log\LogServiceProvider',
                            'Illuminate\Mail\MailServiceProvider',
                            'Illuminate\Database\MigrationServiceProvider',
                            'Illuminate\Pagination\PaginationServiceProvider',
                            'Illuminate\Queue\QueueServiceProvider',
                            'Illuminate\Redis\RedisServiceProvider',
                            'Illuminate\Remote\RemoteServiceProvider',
                            'Illuminate\Auth\Reminders\ReminderServiceProvider',
                            'Illuminate\Database\SeedServiceProvider',
                            'Illuminate\Session\SessionServiceProvider',
                            'Illuminate\Translation\TranslationServiceProvider',
                            'Illuminate\Validation\ValidationServiceProvider',
                            'Illuminate\View\ViewServiceProvider',
                            'Illuminate\Workbench\WorkbenchServiceProvider',
                            'Intervention\Image\ImageServiceProvider',
                            'Mitch\LaravelDoctrine\LaravelDoctrineServiceProvider',
                            'Ivancevich\Analytics\AnalyticsServiceProvider',
                            'Philo\Twitter\TwitterServiceProvider',
                            'Riari\Forum\ForumServiceProvider',
                            'Cornford\Googlmapper\MapperServiceProvider'
                            //'Davzie\LaravelBootstrap\LaravelBootstrapServiceProvider'
            ),

'aliases' => array(

                            'App'               => 'Illuminate\Support\Facades\App',
                            'Artisan'           => 'Illuminate\Support\Facades\Artisan',
                            'Auth'              => 'Illuminate\Support\Facades\Auth',
                            'Blade'             => 'Illuminate\Support\Facades\Blade',
                            'Cache'             => 'Illuminate\Support\Facades\Cache',
                            'ClassLoader'       => 'Illuminate\Support\ClassLoader',
                            'Config'            => 'Illuminate\Support\Facades\Config',
                            'Controller'        => 'Illuminate\Routing\Controller',
                            'Cookie'            => 'Illuminate\Support\Facades\Cookie',
                            'Crypt'             => 'Illuminate\Support\Facades\Crypt',
                            'DB'                => 'Illuminate\Support\Facades\DB',
                            'Eloquent'          => 'Illuminate\Database\Eloquent\Model',
                            'EntityManager'                => 'Mitch\LaravelDoctrine\EntityManagerFacade',
                            'Event'             => 'Illuminate\Support\Facades\Event',
                            'File'              => 'Illuminate\Support\Facades\File',
                            'Form'              => 'Illuminate\Support\Facades\Form',
                            'Hash'              => 'Illuminate\Support\Facades\Hash',
                            'HTML'              => 'Illuminate\Support\Facades\HTML',
                            'Input'             => 'Illuminate\Support\Facades\Input',
                            'Lang'              => 'Illuminate\Support\Facades\Lang',
                            'Log'               => 'Illuminate\Support\Facades\Log',
                            'Mail'              => 'Illuminate\Support\Facades\Mail',
                            'Paginator'         => 'Illuminate\Support\Facades\Paginator',
                            'Password'          => 'Illuminate\Support\Facades\Password',
                            'Queue'             => 'Illuminate\Support\Facades\Queue',
                            'Redirect'          => 'Illuminate\Support\Facades\Redirect',
                            'Redis'             => 'Illuminate\Support\Facades\Redis',
                            'Request'           => 'Illuminate\Support\Facades\Request',
                            'Response'          => 'Illuminate\Support\Facades\Response',
                            'Route'             => 'Illuminate\Support\Facades\Route',
                            'Schema'            => 'Illuminate\Support\Facades\Schema',
                            'Seeder'            => 'Illuminate\Database\Seeder',
                            'Session'           => 'Illuminate\Support\Facades\Session',
                            'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait',
                            'SSH'                       => 'Illuminate\Support\Facades\SSH',
                            'Str'                        => 'Illuminate\Support\Str',
                            'URL'                      => 'Illuminate\Support\Facades\URL',
                            'Validator'             => 'Illuminate\Support\Facades\Validator',
                            'View'                     => 'Illuminate\Support\Facades\View',
                            'Image'                 => 'Intervention\Image\Facades\Image',
                            'Analytics'            => 'Ivancevich\Analytics\AnalyticsFacade',
                            'Twitter'               => 'Philo\Twitter\Facades\Twitter',
                            'Mapper'              => 'Cornford\Googlmapper\Facades\Mapper'
            ),

From: Bradley Cornford [mailto:notifications@github.com] Sent: 04 August 2015 09:31 To: bradcornford/Googlmapper Cc: Samantha Brown Subject: Re: [Googlmapper] Laravel 4 install not working (#7)

Could you send me over you composer.json, and your app.php config files please.

— Reply to this email directly or view it on GitHubhttps://github.com/bradcornford/Googlmapper/issues/7#issuecomment-127526104.

bradcornford commented 9 years ago

Okay, that all looks right to me... Some people have said they have had issue with the facade class, can you try renaming the class 'Cornford\Googlmapper\Facades' to 'Cornford\Googlmapper\MapperFacade' then reference this in your 'app.php' like this:

'Mapper'         => 'Cornford\Googlmapper\Facades\MapperFacade',
SamBrownHTA commented 9 years ago

I just realised I was typing the publish command incorrectly. I was using cornford/googlemapper instead of cornford/googlmapper - without the e!!!

bradcornford commented 9 years ago

Ah yeah, that would do it! I didn't want to use the full Google term in case it infringed on copyright etc... Glad you got this sorted!