SqlFileLoader
Read the SQL file, remove all comments, and separate each command for manipulation., (*1)
Instation
Put in your composer file the command bellow., (*2)
"pedrosoares/sqlfileloader": "1.0.*"
The field "require" shoud be like:, (*3)
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"pedrosoares/sqlfileloader": "1.0.*"
}
How use
To load a file and get all sql commands, you can do in this way:, (*4)
$c = new SqlFileLoader("PATH to the sql file");
foreach($c->getStatements() as $sqlCommand){
DB::statement($sqlCommand);
}