mardi 22 mai 2018

Laravel Schema not returning true on column that exists

I am running larval right now and have a controller with a method that will determine if a column exists in a table for a given table name.

public function checkColumnExists($name){
    return Schema::hasColumn($this->table_name,$name);
}

I also have schema imported at the top of the controller. When I have a table with a. completed_at column for example and I pass that name into the function it will always return false. The table name is passed in with a parameter in the url its the name of the Model and is converted to snake case with the helper function laravel has



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2LhW1vv
via IFTTT

Aucun commentaire:

Enregistrer un commentaire