Does laravel has any gems to extend or modify functionality? - laravel-5

Does laravel has gems like as ruby on rails have? Like, for signup flow ruby on rails has "devise" gem. Does laravel has anything like that?

There is no built-in package manager for Laravel but you can use reference like: https://packalyst.com . Here you can find all available packages for Laravel. All of them can be installed with Composer - php package manager. There is detail description how to install every pack in Packalyst.
If you want to have auth in Laravel you have two options. To do it manually, or to use the built-in module for authentication. You can run
php artisan make:auth
in the main project directory. This will add the required views and routes in the Laravel file structure in order to use the auth. Better to run this command on fresh installation. See this for detailed step by step authentication with Laravel 5: https://laravel.com/docs/5.5/authentication#authentication-quickstart

Related

How to use Vue with Lumen?

I have created a RESTful API with lumen and tested it with postman. It works fine. Now I wanna develop the front end for it with Vue. What is the best way to go about it? Do I need to create a separate directory for Vue or is there a way to use it in the same lumen project directory? I have tried installing composer require laravel/ui which works fine. But then when I run php artisan ui vue it says "ui not defined". Help me out here.
I would suggest to use something like this starter kit. Down the line it will save your time.

Laravel Aws\Kinesis\KinesisClient not found

I would like to use Aws\Kinesis\KinesisClient on my Laravel project but unfortunately, when I install package using
composer require aws/aws-sdk-php
and try to use
use Aws\Kinesis\KinesisClient;
I got
Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Aws\Kinesis\KinesisClient not found.
Please guide me how to use KinesisClient on laravel project.
Regards.
The documentation says that; you need to include vendor/autoload.php before using it.
<?php
// Require the Composer autoloader.
require 'vendor/autoload.php';
use Aws\S3\S3Client;
If you don't want to require on every class you use, then maybe you may check this repository to load with service provider. (more laravel way)
This is a simple Laravel service provider for making it easy to include the official AWS SDK for PHP in your Laravel and Lumen applications.

Using the Google Analytics PHP Client Library in Laravel

I am fairly new to Laravel and am trying to integrate the Google Analytics PHP Client Library (https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-php) in an application I am building.
According to the documentation , the library needs to be installed via Composer and then loaded using:
require_once __DIR__ . '/vendor/autoload.php';
In the vendors folder, I can see that there is a folder named google. So my question is, what would be the correct way to load this library in Laravel? Would it be using the code shown above, or some other method?
Thanks
The autoload.php file is already required by your laravel app, you should be able to access it by it's namespace after running composer dump-autoload as suggested by Ayaz.
You may want to look at a package like https://github.com/spatie/laravel-analytics where they've done the work to integrate the google analytics api into Laravel a bit more. Even if you don't use it I'm sure you can glean some good info from checking out the source files.
According to the documentation , the library needs to be installed via Composer and then loaded
You can do it by executing following command in your git bash or cmd
$ composer dump-autoload

How can I require composer autoloader in the laravel?

I want to install guzzle https://github.com/guzzle/guzzle
I read the reference, but I'm confused this section :
From that tutorial, asking for require composer autoloader. So seems needed to add require 'vendor/autoload.php';
Where I add the script?
I using laravel 5.6
You don't have to do anything if you are going to install guzzle in Laravel.
The example above is for core php actually. Laravel will automatically do it for you.
Just run composer require guzzlehttp/guzzle in your terminal. (of course in the directory where your laravel project actually is.)
And add use GuzzleHttp\Client; at the top of the file you will be calling guzzle from.

create laravel project with laravel installer

I am new to laravel framework,after some search I decided to use laravel 5.1
I read the official document and set the environment,also I install the laravel installer.but when I use laravel installer to create a project, it will use laravel newest version(such as 5.2.*).I want to know how can I specify the laravel version useing laravel installer?
I know I can specify laravel version using composer create-project ...,but for some reason when I using composer I must wait for long time.so is there a way useing laravel installer to create project with specified laravel?
You should be able to do it using this alternative laravel installer.
composer g require artesaos/laravel-installer
And then you can do:
laravel new name version
You may need to uninstall the previous installer you had.

Resources