nmfzone / google-static-map-laravel

Generate Google Static Map in Laravel
MIT License
3 stars 1 forks source link

GoogleStaticMap' not found #1

Closed tenoimelda closed 5 years ago

tenoimelda commented 5 years ago

in my controller public function index () { GoogleStaticMap::make('-7.797068', '110.370529')->setCenter('Indonesia')->setZoom('4')->getUrl(); return view('b'); } in my view

{!! GoogleStaticMap::render() !!}

help

nmfzone commented 5 years ago

@tenoimelda What do you mean? Is there any error? You should describe about what's going on..

tenoimelda commented 5 years ago

I created a function in the controller, but when we try to call, GoogleStaticMap not found error class, I have added the class to the app config, and can you give a simple example of how the function is on the controller? because i'm still a beginner

Pada tanggal 24 Jul 2019 13.42, "Nabil Muh. Firdaus" < notifications@github.com> menulis:

@tenoimelda https://github.com/tenoimelda What's do you mean? Is there any error? You should describe about what's going on..

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nmfzone/google-static-map-laravel/issues/1?email_source=notifications&email_token=AFTBZVCNDXUCUESFJ2XXNFDQA7TUNA5CNFSM4IGMKINKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2VHOKI#issuecomment-514488105, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTBZVF2S74AUBCMNSJYZSTQA7TUNANCNFSM4IGMKINA .

nmfzone commented 5 years ago

@tenoimelda Ok, but since you're not describing about what's going on, I'll give an example based on my understanding. This package is used only to create a url of the static map, so if you want to use in the view, you just need to placed generated URL in the img tag.

Controller

use GoogleStaticMap;

class Welcome extends Controller
{
    public function show()
    {
        $staticUrl = GoogleStaticMap::make('-7.797068', '110.370529')->getUrl();

        return view('your_view_name', compact('staticUrl'));
    }
}

View

<img src="{{ $staticUrl }}" />

just simple as like that.

tenoimelda commented 5 years ago

Thank you for giving an example, but I still get app \ http \ Controller \ GoogleStaticMap not found errors, when I have added it in the config \ app, aliases 'GoogleStaticMap' => MNFCODES \ GoogleStaticMap \ GoogleStaticMapFacades :: class, then I add to the provider too, is there a code that needs to be called again on the controller? for example use GoogleStaticMap, thank you

Pada tanggal 25 Jul 2019 09.30, "Nabil Muh. Firdaus" < notifications@github.com> menulis:

@tenoimelda https://github.com/tenoimelda Ok, but since you're not describing about what's going on, I'll give an example based on my understanding. This package is used only to create an url of the static map, so if you want to use in view, you just need to placed generated URL in the img tag.

Controller

public function show() { $staticUrl = GoogleStaticMap::make('-7.797068', '110.370529')->getUrl();

return view('your_view_name', compact('staticUrl'));

}

View

just simple as like that.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nmfzone/google-static-map-laravel/issues/1?email_source=notifications&email_token=AFTBZVCZSPWLKLGCIZODW3DQBD645A5CNFSM4IGMKINKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2YB6KQ#issuecomment-514858794, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTBZVG7GEF7JNLPWBMUSJDQBD645ANCNFSM4IGMKINA .

nmfzone commented 5 years ago

@tenoimelda I've give you complete example in my previous comment, please read it carefully. What's laravel version you're using? if you use Laravel 5.5, you just need to install, then do nothing, don't need to add anything to the config/app.php.

tenoimelda commented 5 years ago

I use laravel 5.4 and php 7, did I make a mistake? If yes, let me know, thank you for taking the time

Pada tanggal 25 Jul 2019 10.56, "Nabil Muh. Firdaus" < notifications@github.com> menulis:

@tenoimelda https://github.com/tenoimelda I've give you complete example in my previous comment, please read it carefully. What's laravel version you're using? if you use Laravel 5.5, you just need to install, then do nothing, don't need to add anything to the config/app.php.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nmfzone/google-static-map-laravel/issues/1?email_source=notifications&email_token=AFTBZVBJDNLAYHHMXLCFILLQBEI7NA5CNFSM4IGMKINKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2YF7AQ#issuecomment-514875266, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTBZVFKJKI7H3COKRJZEQDQBEI7NANCNFSM4IGMKINA .

nmfzone commented 5 years ago

@tenoimelda Oh, ok. Have you read my example code carefully? In this section:

use GoogleStaticMap;

class Welcome extends Controller
{
    public function show()
    {
        $staticUrl = GoogleStaticMap::make('-7.797068', '110.370529')->getUrl();

        return view('your_view_name', compact('staticUrl'));
    }
}
tenoimelda commented 5 years ago

Bang orang Indonesia ya, saya coba dm aja ya bang di instagram

Pada tanggal 25 Jul 2019 11.13, "Nabil Muh. Firdaus" < notifications@github.com> menulis:

@tenoimelda https://github.com/tenoimelda Oh, ok. Have you read my example code carefully? In this section:

use GoogleStaticMap;

class Welcome extends Controller { public function show() { $staticUrl = GoogleStaticMap::make('-7.797068', '110.370529')->getUrl();

    return view('your_view_name', compact('staticUrl'));
}

}

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nmfzone/google-static-map-laravel/issues/1?email_source=notifications&email_token=AFTBZVAYLMOW5KBDT5AYDL3QBEK4DA5CNFSM4IGMKINKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2YGVOI#issuecomment-514878137, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTBZVDTU4JU5MFKAQ5MCNTQBEK4DANCNFSM4IGMKINA .

nmfzone commented 5 years ago

@tenoimelda Hzzzzzz, nope. Just use this comment section & be english 😄

tenoimelda commented 5 years ago

Wkwkwk haduh, bang ayolah bantu dulu 🙏🙏🙏🙏

Pada tanggal 25 Jul 2019 11.31, "Nabil Muh. Firdaus" < notifications@github.com> menulis:

@tenoimelda https://github.com/tenoimelda Hzzzzzz, nope. Just use this comment section & be english 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nmfzone/google-static-map-laravel/issues/1?email_source=notifications&email_token=AFTBZVAXQ7P46MFG6EYQ3OTQBENBFA5CNFSM4IGMKINKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2YHPGY#issuecomment-514881435, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTBZVCPSYHB72TS25SN3TDQBENBFANCNFSM4IGMKINA .

nmfzone commented 5 years ago

@tenoimelda haha, nope nope. Jelaskan aja lewat sini, biar bermanfaat buat yg lain.

tenoimelda commented 5 years ago

Oke bang, jadi gini saya sudah buat function intinya udah semua banh, nah yg saya bingung kenapa masih not found GoogleStaticMap, nahh kalo kaya package lain kan tinggal tambah kan di controller use bla bla bla, nahh kira kira kenapa ya bang soal not found GoogleStaticMap, terimakasih bang atas respon nya

Pada tanggal 25 Jul 2019 11.34, "Nabil Muh. Firdaus" < notifications@github.com> menulis:

@tenoimelda https://github.com/tenoimelda haha, nope nope. Jelaskan aja lewat sini, biar bermanfaat buat yg lain.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nmfzone/google-static-map-laravel/issues/1?email_source=notifications&email_token=AFTBZVGLSZNQCTGISDP2WZTQBENMVA5CNFSM4IGMKINKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2YHTOI#issuecomment-514881977, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTBZVHD5Q6EO4PIOZEIHH3QBENMVANCNFSM4IGMKINA .

nmfzone commented 5 years ago

@tenoimelda Use english please 😄

Perhatikan contoh yg udah tak berikan, harusnya sudah jelas lho. Kecuali emang kalau kode yg tak bikin ada yg ngebug.

Udah ada bagian ini?

use GoogleStaticMap;
tenoimelda commented 5 years ago

Ok, succesfully but, once i compact variabel for my view undifined variabel, do i have looping foreach?

Pada tanggal 25 Jul 2019 11.38, "Nabil Muh. Firdaus" < notifications@github.com> menulis:

@tenoimelda https://github.com/tenoimelda Use english please 😄

Perhatikan contoh yg udah tak berikan, harusnya sudah jelas lho. Kecuali emang kalau kode yg tak bikin ada yg ngebug.

Udah ada bagian ini?

use GoogleStaticMap;

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nmfzone/google-static-map-laravel/issues/1?email_source=notifications&email_token=AFTBZVAHFBFFYX5JEV3CAQ3QBEN43A5CNFSM4IGMKINKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2YHZEQ#issuecomment-514882706, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTBZVCCKWBJRSJMUOBZAE3QBEN43ANCNFSM4IGMKINA .

nmfzone commented 5 years ago

@tenoimelda hemmmmm, as I suspect.

I don't know your code, so please use something like https://codeshare.io, so I can re check your code.

tenoimelda commented 5 years ago

This my link, https://codeshare.io/5QLjnW please tell me if i wrong, i think its possible to call the variable wrong in the view duh bang, kalo ada typo penulisan kasih tau pliss

On Thu, 25 Jul 2019 at 11:16, Nabil Muh. Firdaus notifications@github.com wrote:

@tenoimelda https://github.com/tenoimelda hemmmmm, as I suspect.

I don't know your code, so please use something like https://codeshare.io, so I can re check your code.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nmfzone/google-static-map-laravel/issues/1?email_source=notifications&email_token=AFTBZVHPJGFTOS34HUAWOQDQBESLXA5CNFSM4IGMKINKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2YJJCA#issuecomment-514888840, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTBZVCRK4WLNCDGAOHKRP3QBESLXANCNFSM4IGMKINA .

nmfzone commented 5 years ago

@tenoimelda I've read your code, and as I suspect, you don't read my example code carefully. The usage of PHP compact isn't like that. You should write it like this:

compact('real')

Each params in compact represent each variable before it.

tenoimelda commented 5 years ago

Yeahh It works, but the map hasn't appeared yet, does Google Maps have to be added to the key API?

Pada tanggal 25 Jul 2019 12.32, "Nabil Muh. Firdaus" < notifications@github.com> menulis:

Closed #1 https://github.com/nmfzone/google-static-map-laravel/issues/1.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nmfzone/google-static-map-laravel/issues/1?email_source=notifications&email_token=AFTBZVHKSHZYRXSB4BKINLLQBEUGLA5CNFSM4IGMKINKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOSWAUXZQ#event-2508278758, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTBZVFH67RLPKVHFX6LM4LQBEUGLANCNFSM4IGMKINA .

nmfzone commented 5 years ago

Of course dude. You should've Google Maps API key.

tenoimelda commented 5 years ago

Okeeey thank you very much 🙏

Pada tanggal 25 Jul 2019 13.13, "Nabil Muh. Firdaus" < notifications@github.com> menulis:

Of course dude. You should've Google Maps API key.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nmfzone/google-static-map-laravel/issues/1?email_source=notifications&email_token=AFTBZVGBNBIKKMYDPRKBI7TQBEY55A5CNFSM4IGMKINKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2YLYSI#issuecomment-514899017, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTBZVFSJI73IHHIVJNLZZ3QBEY55ANCNFSM4IGMKINA .

nmfzone commented 5 years ago

@tenoimelda You're welcome! Star this package if you found this package is useful 🥇