pingpong-labs / admin

Laravel 5 Admin
https://packagist.org/packages/pingpong/admin
BSD 3-Clause "New" or "Revised" License
432 stars 114 forks source link

Cannot declare class Pingpong\Presenters\Model because the name is already in use #10

Closed noxify closed 10 years ago

noxify commented 10 years ago

Hi,

after running

composer update

with the following response:

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing pingpong/presenters (1.0.2)
  - Installing pingpong/presenters (1.0.3)
    Downloading: 100%         

Writing lock file
Generating autoload files
Generating optimized class loader

I got the error message:

Cannot declare class Pingpong\Presenters\Model because the name is already in use

This message prompts even when I try to open the pages/articles in the admin panel.

Log file:

[2014-10-21 20:31:24] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Cannot declare class Pingpong\Presenters\Model because the name is already in use' in /Applications/MAMP/htdocs/ping-admin/vendor/pingpong/presenters/src/Pingpong/Presenters/Model.php:5
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
#1 {main} [] []
noxify commented 10 years ago

To solve this problem, you have to update the file:

vendor/pingpong/src/PingPong/Presenters/Model.php

with the following

<?php namespace Pingpong\Presenters;
//OLD
// use Illuminate\Database\Eloquent\Model;
// class Model extends Model implements PresentableInterface {

//NEW
use Illuminate\Database\Eloquent\Model as EloquentModel;
class Model extends EloquentModel implements PresentableInterface {

    use PresentableTrait;

}