How to install Laravel 4 profiler - laravel-4

I'm a Ubuntu/git/composer noob, and I'm trying to follow the installation instructions here.
After running the php artisan config:publish loic-sharma/profiler command I get the following error:
PHP Fatal error: Class 'Profiler\ProfilerServiceProvider' not found in /var/www/epcr/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 158
I'm assuming the problem is that I haven't downloaded the code, but I'm not exactly sure how to go about doing that.

Most packages require you to manually add service provider in app/config/app.php. There is an array of providers inside.
Some providers require also facade alias.
So take a look at documentation, if it is provider, then it should be documented.
e.g.
'Miro\JSONSuite\JSONSuiteServiceProvider'

Try running composer dump-autoload

I needed to run composer update after I added the require to my composer.json file. After that I had a few permissions I needed to update and it worked after that.

Related

Class 'Stripe\Stripe' not found error in PHP

I installed laravel and composer and created my first project in laravel. I want to integrate stripe using PHP. When I try to execute my first project in localhost I take this message:
Fatal error: Class 'Stripe\Stripe' not found in C:\xampp\htdocs\laravel\stripe\public\elda.php on line 21
To include the stripe libraries, I inserted inside the composer.json file the code from the API library for PHP. Here is an image of my composer.json file:
I run composer install in cmd and this is the output:
You may be getting outdated dependencies. Run update to update them.
I run composer update and the output is the error in the image below:
Can someone help me to solve this error?
Well, sorry did not make a comment of your post, but I have not enough points to do so. But you need to run composer install in the terminal after that includes a new package.
I had the same issue, but when I ran this command my issue is resolved.
composer require stripe/stripe-php
I hope this may help you, after you update your composer.

artisan not working in laravel 5.2 returning [ErrorException]

I'm getting problem when trying to execute php artisan "command". Does not matter the command.
For example, executing the command:
php artisan make:controller TestController
I have got the following result
[ErrorException]
Undefined variable: ths
What I have tried to do?
I have tried to update/install composer
composer update
composer install
composer dump-autoload
It's causing me a lot of problem for example I can't execute my migration in another words I can't take the next steps.
Would be great if someone has some idea how to fix that.
Thank's a lot
This error means that somewhere you have a class with $ths variable and it's not related to commands. I think you wrote some code and used $ths instead of $this. Check all last changes (custom commands, facades, service providers etc). Just fix it and commands will work again.
If you can't find $ths in your code, check Laravel error logs for extra info.
I suggest finding this in your code. If you use Sublime Text press:
The keyboard shortcut is Ctrl⇧+F on non-Mac (regular) keyboards, and ⌘⇧+F on a Mac.
And put $this on this variable instead of $ths

Laravel deleting package with composer

I tried to delete barryvdh/laravel-debugbar from my laravel installation, and it seems I didn't make something right.
What I did so far :
composer remove barryvdh/laravel-debugbar
I deleted then the references in config/app.php
And I've got an error :
[RuntimeException]
Error Output: PHP Fatal error:
Class 'Barryvdh\Debugbar\ServiceProvider' not found in
{mypath}\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php on line 146
I tried dump-autoload, clear-compiled, but none works.
What did I miss ?
22/02/2016 Edit : I also tried to remove ALL the vendor folder, then install it again via composer install, but I got the error again when the command php artisan clear-compiled was run angain.
Ok, it seems I had played with artisan commands, and the configuration file was cached (via php artisan config:cache).
I deleted it (in bootstrap/cache/config.php) and everything works like a charm, but I also could have used the command php artisan config:clear to remove it.
When you installed Debugbar, after the package was install via composer you needed to add the class to the providers array in config/app.php. So you need to remove this line from there:
Barryvdh\Debugbar\ServiceProvider::class
If you also register the facade, then you need to remove the following from the aliases array from the same file:
'Debugbar' => Barryvdh\Debugbar\Facade::class
If you also ran php artisan vendor:publish (which is the final step described in the Installation Section from the package readme) then you can delete the config/debugbar.php file as well, although leaving that configuration file in place will not cause any issues.
Marc Brillault's answer is correct. I am adding more clarification to that answer:
I removed debug bar class manually from the catch files. present in (bootstrap/cache/config.php).
Steps for How to remove manually class.
1.) Open this two files
`bootstrap/cache/config.php`
`config/app.php`
2.) Find this two line and remove It.
Barryvdh\Debugbar\ServiceProvider::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class,
3.) run command `php artisan config:clear`
after the following this step check command php artisan list is working well.
you must:
First. Delete the references to Debugbar in config/app.php
Second. composer remove barryvdh/laravel-debugbar
In that order. If you don't, Laravel get confused ;)
The best ways you need to do is delete all file manually in all composer files.

Installing Zizaco entrust and confide

I am following the instruction of the link
https://github.com/Zizaco/entrust
I have written "zizaco/entrust": "dev-master" in require section of composer.json and then update it on command prompt by the command php composer.json update.
I have also run the command php composer.json dump-autoload.
It gets updated.
I have added the provider and alias line in app.php and in Auth.php model and table is also set as 'users'.
But when I run the command php artisan entrust:migration
It shows me the error as follows
Please help me as I need to work on it fast.
Kindly let me know what and where is the problem.
Help is appreciated.
I had a similar problem where by each time I run 'composer update' the packages I needed where not included as I expected. So as my solution, each time I want to start a project in laravel 4, I first edit my composer.json file before running 'composer install'. Since then I do not have such embarrassment again.

Laravel: Can't install Sentry

I tried to install Sentry 2 with composer. I used the composer manuel from the sentry site,
but i got always a serviceprovider exception:
"Class 'Cartalyst\Sentry\SentryServiceProvider' not found"
Is there an another way or i did something wrong?
If you look closely on the [Sentry website installer instructions for laravel 4],
step one states that you need to add "cartalyst/sentry": "2.0.*" to your composer.json,
but it also specifically states that it requires you to run php composer.phar update from the command line
Note that you should run php composer.phar update BEFORE you add the entries for the app/config/app.php (before proceeding to steps 2 and above)
#Todd Isaacs's answer would also lead you to the required result but you do not need to go back to the beggining, all you have to do is revert the changes on your app/config/app.php file and run the update.
hope that helps.
I found the solution. SSL is necessary for composer update and now all works fine.
So I checked the php ini and set ssl on.
I just got this same error and being totally new at Laravel I decided to step back, here is what I did to resolve it.
removed the entries I added to my composer.json and app.php (I think app.php was the issue)
run composer update (yep worked this time)
added "cartalyst/sentry": "2.0.*" to my composer.json
run composer update (sentry was installed)
added 'Cartalyst\Sentry\SentryServiceProvider' and 'Sentry' => 'Cartalyst\Sentry\Facades\Laravel\Sentry' to my app.php
run composer update (still works)
When I originally installed Sentry I added the 'Cartalyst\Sentry\SentryServiceProvider' to the app.php before running the update and I think this was the issue. ( install instructions )
For Sentry 3, change the service provider in app/config/app.php to:
'Cartalyst\Sentry\Laravel\SentryServiceProvider',

Resources