SQLITE and Laravel Query Builder and Eloquent
CREATE TABLE token (
id INTEGER PRIMARY KEY NOT NULL ,
baz varchar(255) NOT NULL,
user_id INTEGER DEFAULT NULL,
status varchar(255) NOT NULL,
created_at timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’ ,
updated_at timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’
) ;
+ Add index foo
Eloquent:
$token = new Token;
$token->foo = ‘ghgfhfghfghfg’;
$token->status = ‘sfdsfsdsd’;
$token->save();
echo $token->foo; /// !
QueryBuilder:
DB::table(‘token’)->insert(
array(‘foo’ => ‘dsadasdasdasdaf’, ‘status’ => ‘dsfdsfsdfasfdsafasd’)
);