Category Archives: Laravel

Laravel SVG directive

I was working on a site and uses Steve Schoger‘s Heroicons. The Heroicons are svg based and it works best with SVG using HTML inline.

I wrote a custom blade directive so that I can include the inline SVG easily with blade directive.


When I need to use a Heroicons svg, I just need to call it with

@svg('heroicon-user-plus-sm')

given that the svg file is already copied into public/svg directory.

Advertisements

Laravel Socialite and Google

Google announced their plan to shutdown Google+ by March 2019. Along with the Google+ platform, the Google+ API will be depreciated too.

On Laravel Socialite, it used to use Google+ to authenticate, but it no longer uses Google+ platform.

If you are using Socialite 4.x, your project in the Google Cloud Platform no longer needs to enable Google+ API since the default scope is already selected for authentication needs.

That’s all you need to use Google OAuth with Laravel Socialite

Update Laravel Socialite from using Google+ API

68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d736f6369616c6974652e737667

The Laravel Socialite uses Google+ API to authenticate user, but since Google+ API is shutting down, the https://www.googleapis.com/plus/v1/people/me will no longer works.

If you are currently using Google+ API for Socialite Google OAuth2 authentication, you should upgrade Socialite version 4.

If are stuck with Socialite version 3.x because you need to run Laravel with lower or equal to version 5.5 (or because of PHP 7.0), change the composer package to 3.0.x-dev and run composer update as of this writing.

I am expecting Laravel Socialite 3.x Google OAuth API will be updated soon, but the package has not yet released.