added models

This commit is contained in:
chrosey 2017-06-10 14:14:53 +02:00
parent ebb2728c18
commit 609231b044
11 changed files with 274 additions and 0 deletions

33
.env Normal file
View File

@ -0,0 +1,33 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:nTwR/ubN9sM6fOaWIOtEaio9b9GNLtSu3HmThqxb0Fg=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=laravel
DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=

10
app/Arbeitsplatz.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Arbeitsplatz extends Model
{
protected $table = "arbeitsplaetze";
}

10
app/Benutzer.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Benutzer extends User
{
protected $table = "benutzer";
}

10
app/Einteilung.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Einteilung extends Model
{
protected $table = "einteilungen";
}

10
app/Eintragung.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Eintragung extends Model
{
protected $table = "eintragungen";
}

11
app/Veranstaltung.php Normal file
View File

@ -0,0 +1,11 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Veranstaltung extends Model
{
protected $table = "veranstaltungen";
//
}

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBenutzersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::rename("users", "benutzer");
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::rename('benutzer',"users");
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateVeranstaltungsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('veranstaltungen', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->dateTime('beginn');
$table->string('name',200);
$table->integer('gaeste')->unsigned();
$table->string('hinweise',2000);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('veranstaltungen');
}
}

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateEintragungsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('eintragungen', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->integer('benutzer_id')->unsigned();
$table->foreign('benutzer_id')->references('id')->on('benutzer');
$table->integer('veranstaltung_id')->unsigned();
$table->foreign('veranstaltung_id')->references('id')->on('veranstaltungen');
$table->boolean('nicht_unbedingt')->default(false);
$table->dateTime('kann_ab')->nullable();
$table->dateTime('kann_bis')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('eintragungen');
}
}

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateEinteilungsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('einteilungen', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->dateTime('start');
$table->dateTime('ende')->nullable();
$table->integer('benutzer_id')->unsigned();
$table->foreign('benutzer_id')->references('id')->on('benutzer');
$table->integer('veranstaltung_id')->unsigned();
$table->foreign('veranstaltung_id')->references('id')->on('veranstaltungen');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('einteilungen');
}
}

View File

@ -0,0 +1,44 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateArbeitsplatzsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('arbeitsplaetze', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('name',50);
});
Schema::table('einteilungen', function (Blueprint $table) {
$table->integer('arbeitsplatz_id')->unsigned();
$table->foreign('arbeitsplatz_id')->references('id')->on('arbeitsplaetze');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('einteilungen', function (Blueprint $table) {
$table->dropForeign('einteilungen_arbeitsplatz_id_foreign');
$table->dropColumn('arbeitsplatz_id');
});
Schema::dropIfExists('arbeitsplaetze');
}
}