Laratrust\MigrationCommand::createMigration PHP Method

createMigration() protected method

Create the migration.
protected createMigration ( ) : boolean
return boolean
    protected function createMigration()
    {
        $migrationPath = $this->getMigrationPath();
        $userModel = Config::get('auth.providers.users.model');
        $user = new $userModel();
        $laratrust = Config::get('laratrust');
        $data = compact('user', 'laratrust');
        $output = $this->laravel->view->make('laratrust::generators.migration')->with($data)->render();
        if (!file_exists($migrationPath) && ($fs = fopen($migrationPath, 'x'))) {
            fwrite($fs, $output);
            fclose($fs);
            return true;
        }
        return false;
    }