5

( ! ) Fatal error: Cannot redeclare measure() (previously declared in C:\wamp64\www\acellemailll\vendor\barryvdh\laravel-debugbar\src\helpers.php:77) in C:\wamp64\www\acellemailll\app\Helpers\helpers.php on line 427

5
  • Please describe why installing "debugbar" will resolve your issue? Accordingly to the error message you have it installed already. github.com/barryvdh/laravel-debugbar Commented Apr 15, 2018 at 9:14
  • After i install the debugbar it shows that message and the project doesn't run anymore; what i meant is how can i install it without this error Commented Apr 16, 2018 at 8:55
  • The error is in YOUR code (...\acellemailll\app\Helpers\helpers.php file). You are re-declaring the global function named measure() that is already defined by Laravel Debugbar package. You cannot do that -- it's basic PHP knowledge. Give your function another name... or get rid of Laravel Debugbar package so it does not introduce that function in first place. Commented Apr 16, 2018 at 9:39
  • i changed the function name in my code and it still doesn't show the bar of debug Commented Apr 16, 2018 at 11:03
  • "...it still doesn't show the bar of debug" -- so it must be some another issue. E.g. did you added that package ServiceProvider into appropriate place? Auto-discovery is available since Laravel 5.5; before that they should be added manually. Follow the instructions. Commented Apr 16, 2018 at 11:25

3 Answers 3

12

Open the terminal and to do like this as your wise

1) Install DebugBar

  • The DebugBar 2.4.x is for Laravel 5.4-
  • The DebugBar 3.0.x is for Laravel 5.5+

A) Install the debuger 2.4 (Documentation)

composer require barryvdh/laravel-debugbar:~2.4

You will also need to add in providers array in config/app.php :

Barryvdh\Debugbar\ServiceProvider::class

B) Install the debuger 3.0 (Documentation)

composer require barryvdh/laravel-debugbar --dev

2) After that, you need to update the composer

composer update

3) Clear cache and config

php artisan cache:clear

php artisan config:cache

4) Then after you need to add a line to .env file

APP_DEBUG=true
Sign up to request clarification or add additional context in comments.

Comments

4

Navigate to your project folder and paste in the following

composer require barryvdh/laravel-debugbar --dev

Comments

1

composer require barryvdh/laravel-debugbar

open config/app.php and inside the ‘providers’ array add:

'Barryvdh\Debugbar\ServiceProvider',

https://laravel-news.com/laravel-debugbar

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.