I found this tutorial to install a plugin for Laravel and have its methods completed by PHPStorm.
I does not seem to work for Lumen. Are there any solutions out there that currently support Lumen since Lumen is kind of a subset of Laravel?
Laravel-ide-helper supports Lumen as of August 2015. Here's what you need to do:
Either execute the command
composer require barryvdh/laravel-ide-helper
or add the following to the require key in composer.json:
"barryvdh/laravel-ide-helper": "2.*"
Once you have installed the dependency, edit the file bootstrap/app.php and look for the Register Service Providers section and add the following line:
$app->register(Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
After that, you just need to create the _ide_helper.php file with the following command:
php artisan ide-helper:generate
Related
Deploying my Laravel 7 app in Heroku I get this error, it appears only in Heroku, not on my local box (localhost)
Class 'NumberFormatter' not found (View: ...)
Server Details:
Heroku
PHP 7.4.12
Laravel Framework 7.30.4
The NumberFormatter classDocs requires the PHP Internationalization extension (intl)Docs, and this extension is not available built-in on Heroku Heroku Built-in ExtensionsHeroku Docs.
Instead Heroku gives you permission to use optional extensionsHeroku Docs.
To make use of them you can either use the composer command to require it ("ext-intl"):
composer require ext-intl
Or you can manually add this to composer.json in the require sectionComposer Docs:
{
"require": {
"ext-intl": "*"
}
}
Commit the file and push the changes to Heroku. The error should be gone until you find the next missing class.
This is another example, why it is a good idea if you have a Composer based PHP project, to document the extensions in use as well in the composer.json file.
When the day comes, you have them documented in the Composer JSON already.
And systems like Heroku can benefit from it, too!
Hi I am new to laravel and trying to install the Laravel passport on an existing laravel project. I am trying to run this command
composer require Laravel/passport
When I run the command it shows nothing to install or update. But, I can see that in my composer I have Laravel version ~4.0 and I am using PHP7.1. I have also installed one of its dependency illuminator/encryption=5.4.36.
Can somebody help me out? How to install my Laravel passport?
I am running laravel 5.4.36 (it's locked)
PS: Had to remove composer file content.
You have already installed Laravel Passport. Your composer / console returns that message because its already downloaded.
Your composer.json tells you that you downloaded version 4.0:
"laravel/passport": "~4.0",
Now you just have to move on I recommened going through the documentation.
There is also a nice tutorial from Taylow Otwell regarding Laravel Passport.
https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/13
To get started, install Passport via the Composer package manager:
composer require laravel/passport
Next, register the Passport service provider in the providers array of your config/app.php configuration file:
Laravel\Passport\PassportServiceProvider::class,
then the command line again type:
php artisan migrate
For more info look: https://laravel.com/docs/5.4/passport
php artisan workbench vendor/package --resources
command is not available in laravel 5, but how now create package in laravel 5 ?
Shameless self-promotion, but I've written a post about this called "Creating Laravel 5 packages for dummies" that explains how to create the package, how to put it on GitHub & Packagist and how to push changes/new versions afterwards.
If you're already familiar with creating packages in Laravel 4, the fastest solution I've found was to use this CLI tool.
The laravel workbench has been renamed in laravel 5 to "Package Development" in the documentation
http://laravel.com/docs/master/packages
Notice that there is no longer a workbench command and you need to create your own package structure, as the Laravel creator want to limit the dependency between created packages and the Laravel framework (#ref)
UPDATE: Laravel 5 is now stable and the illuminate/workbench package can be used in a laravel 5 application as I suggested in this post
In Laravel, these are some handy tricks I follow each time I need to create a Laravel package
Solution 1: Get a boilerplate template from https://github.com/cviebrock/laravel5-package-template, and put it under packages/ (follow the instruction in the repo)
Solution 2: Use a packager (with Laravel >= 5.5)
Install packager it as dev dependency > composer require jeroen-g/laravel-packager --dev (check instruction in the repo here)
create the package > composer require jeroen-g/laravel-packager --dev etc, see full tuto
then, we have a choice to keep the package in our project, or just remove it by rollingback composer.json
Hope this is a good update for Laravel lovers ;)
I am new with laravel. I have no idea how to install aimeos in laravel 5.1, since the installation guide for laravel 5.0, there is a different service provider in between L5 and L5.1.
I got this error:
C:\xampp\htdocs\classic>composer require aimeos/aimeos-laravel
Using version ^1.0 for aimeos/aimeos-laravel
./composer.json has been updated
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Aimeos\Shop\ShopServiceProvider' not found
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
Please help me.
There's no difference between Laravel 5.0 and 5.1 when installing the Aimeos web shop package:
https://aimeos.org/docs/Laravel/Install_Aimeos
Update:
There seems to be a problem due to a recent change in Laravel 5.1.x because the service provider is now used before composer installs the package. I've fixed this in my test installation by
removing the the provider from config/app.php
removing the Aimeos related artisan commands in the "scripts" section of the composer.json file
running "composer update" afterwards with the aimeos-laravel package as requirement
executing the artisan tasks ("vendor:publish", "migrate", "aimeos:setup", "aimeos:cache") afterwards by hand
Download https://github.com/aimeos/aimeos-laravel.
place package to root or desired folder and while updating the composer set
"require": {
.......
"laravel/framework": "^5.1.11",
......
}
then brows
https://aimeos.org/docs/Laravel/Install_Aimeos#Laravel_5.0.2F5.1_and_Aimeos_1.0 Link and follow the instructions.
php artisan workbench vendor/package --resources
command is not available in laravel 5, but how now create package in laravel 5 ?
Shameless self-promotion, but I've written a post about this called "Creating Laravel 5 packages for dummies" that explains how to create the package, how to put it on GitHub & Packagist and how to push changes/new versions afterwards.
If you're already familiar with creating packages in Laravel 4, the fastest solution I've found was to use this CLI tool.
The laravel workbench has been renamed in laravel 5 to "Package Development" in the documentation
http://laravel.com/docs/master/packages
Notice that there is no longer a workbench command and you need to create your own package structure, as the Laravel creator want to limit the dependency between created packages and the Laravel framework (#ref)
UPDATE: Laravel 5 is now stable and the illuminate/workbench package can be used in a laravel 5 application as I suggested in this post
In Laravel, these are some handy tricks I follow each time I need to create a Laravel package
Solution 1: Get a boilerplate template from https://github.com/cviebrock/laravel5-package-template, and put it under packages/ (follow the instruction in the repo)
Solution 2: Use a packager (with Laravel >= 5.5)
Install packager it as dev dependency > composer require jeroen-g/laravel-packager --dev (check instruction in the repo here)
create the package > composer require jeroen-g/laravel-packager --dev etc, see full tuto
then, we have a choice to keep the package in our project, or just remove it by rollingback composer.json
Hope this is a good update for Laravel lovers ;)