Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# |------------------------------- |
# Basic App Settings ----------- |
# |------------------------------- |
APP_NAME="RawPHP"
APP_DEBUG=true

# |------------------------------- |
# Database Settings ----------- |
# |------------------------------- |
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_NAME=raw-php
DB_USERNAME=raw-php
DB_PASSWORD=secret
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor/*
bootstrap/*
config/DatabaseConfig.php
.env
50 changes: 50 additions & 0 deletions app/Database/Migrations/Migration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

namespace App\Database\Migrations;

use Illuminate\Database\Capsule\Manager as Capsule;
use Phinx\Migration\AbstractMigration;

class Migration extends AbstractMigration
{
/**
* The name of the database schema to use.
*
* @var string|null
*/
protected $schema;

/**
* The name of the database connection to use.
*
* @var string|null
*/
protected $connection;

/**
* Enables, if supported, wrapping the migration within a transaction.
*
* @var bool
*/
public $withinTransaction = true;

/**
* Get the migration initiated.
*
* @return string|null
*/
public function init()
{
$this->schema = (new Capsule)->schema();
}

/**
* Get the migration connection name.
*
* @return string|null
*/
public function getConnection()
{
return $this->connection;
}
}
22 changes: 22 additions & 0 deletions app/Database/Migrations/MigrationStub.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

use $useClassName;
use Illuminate\Database\Schema\Blueprint;

class $className extends $baseClassName
{

public function up()
{
$this->schema->create('', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}

public function down()
{
$this->schema->dropIfExists('');
}

}
Loading