Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLSTATE[42703]: Undefined column: 7 ERROR: column "route" of relation "logs" does not exist #57

Closed
edcaron opened this issue May 31, 2016 · 1 comment

Comments

@edcaron
Copy link

edcaron commented May 31, 2016

Its happenig this error after insert an especific object on my db:

QueryException in Connection.php line 713:
SQLSTATE[42703]: Undefined column: 7 ERROR: column "route" of relation "logs" does not exist
LINE 1: ...ue", "owner_type", "owner_id", "user_id", "type", "route", "...
^ (SQL: insert into "logs" ("old_value", "new_value", "owner_type", "owner_id", "user_id", "type", "route", "ip", "created_at", "updated_at") values (null, {"eventos_id":"2","nome":"nome","descricao":"desc"}, App\Model\Patrocinador, 12, 1, created, sponsors.store, 127.0.0.1, 2016-05-31 23:16:23, 2016-05-31 23:16:23))

my composer

"require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "laravelcollective/html": "5.2.*",
        "owen-it/laravel-auditing": "^2.2"
    },

my model:

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use OwenIt\Auditing\AuditingTrait;

class Patrocinador extends Model
{
    use AuditingTrait;

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'patrocinadores';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['descricao', 'eventos_id', 'logo', 'nome'];

    /**
    * Get the evento that owns the Patrocinador.
    */
    public function evento()
    {
        return $this->belongsTo('App\Model\Evento');
    }
}

where i store my object ( my controller)

public function store(Request $request)
    {
        $sponsor = Patrocinador::create($request->all());

        session()->flash('message', 'ok');      

        return response()->json('true');    
    }

obs:
-i haven't modified anything especial on this model .
-the object i'm trying to store was saved, only the log wasn't

the entire error page .hmtl is here to download

@edcaron
Copy link
Author

edcaron commented Jun 1, 2016

i forgot to run
php artisan vendor:publish --provider="OwenIt\Auditing\AuditingServiceProvider"
before php artisan migrate.
Running this solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant