This commit is contained in:
frederikpyt 2020-08-04 14:11:05 +02:00
parent f5a0174939
commit 66f7e3b86b
12 changed files with 8 additions and 292 deletions

View File

@ -1,34 +0,0 @@
<?php
//The Model to a certain Controller, should contain a class with Controller name to which it belongs.
// Allows needed strings to passed onto the database. if there is none needed. the class should appear empty.
//Reference to where the file belongs.
namespace App;
//allows the use of Model library
use Illuminate\Database\Eloquent\Model;
//Class of which should extend Model Library
class Album extends Model
{
//protected variable which contains name of database field(s) to be filled.
protected $fillable = [
'name'
];
public function parentAlbum()
{
return $this->belongsTo('App\Album');
}
public function images()
{
return $this->hasMany('App\Image');
}
public function videos()
{
return $this->hasMany('App\Video');
}
}

View File

@ -1,16 +0,0 @@
<?php
//The Model to a certain Controller, should contain a class with Controller name to which it belongs.
// Allows needed strings to passed onto the database. if there is none. class should appear empty.
//Reference to where the file belongs.
namespace App;
//allows the use of Model library
use Illuminate\Database\Eloquent\Model;
//Class of which should extend Model Library
class CalendarDate extends Model
{
//
}

View File

@ -1,17 +0,0 @@
<?php
//The Model to a certain Controller, should contain a class with Controller name to which it belongs.
// Allows needed strings to passed onto the database. if there is none. class should appear empty.
//Reference to where the file belongs.
namespace App;
//allows the use of Model library
use Illuminate\Database\Eloquent\Model;
//Class of which should extend Model Library
class CalendarEvent extends Model
{
//
}

View File

@ -1,85 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Album;
use Illuminate\Http\Request;
class AlbumController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param \App\Album $album
* @return \Illuminate\Http\Response
*/
public function show(Album $album)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Album $album
* @return \Illuminate\Http\Response
*/
public function edit(Album $album)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Album $album
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Album $album)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param \App\Album $album
* @return \Illuminate\Http\Response
*/
public function destroy(Album $album)
{
//
}
}

View File

@ -1,34 +0,0 @@
<?php
//Migrations acts as a version control for the database allowing you to modify the app's database schema
//allows use of necessary libraries
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}

View File

@ -20,9 +20,11 @@ class CreateWashingReservations extends Migration
$table->timestamp("time");
$table->timestamps();
$table->unsignedBigInteger('machine_id');
$table->foreign("machine_id")->references('id')->on('washing_machines');
$table->foreignid("machine_id")->constrained("washing_machines", "id");
$table->unsignedBigInteger('user_id');
$table->foreign("user_id")->references('id')->on('users');
$table->foreignid("user_id")->constrained("users", "id");
$table->unique(['time', 'machine_id']);
});
}

View File

@ -1,33 +0,0 @@
<?php
//Migrations acts as a version control for the database allowing you to modify the app's database schema
//allows use of necessary libraries
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCalendarDates extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('calendar_dates', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('calendar_dates');
}
}

View File

@ -1,33 +0,0 @@
<?php
//Migrations acts as a version control for the database allowing you to modify the app's database schema
//allows use of necessary libraries
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCalendarEvents extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('calendar_events', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('calendar_events');
}
}

View File

@ -1,34 +0,0 @@
<?php
//Migrations acts as a version control for the database allowing you to modify the app's database schema
//allows use of necessary libraries
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAlbumsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('albums', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->foreignId('user_id')->constrained();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('albums');
}
}

View File

@ -22,7 +22,7 @@ class CreateResourceExtension extends Migration
$table->unsignedInteger("resource_category_id");
$table->timestamps();
$table->foreign("resource_category_id")->references("id")->on("resource_categories");
$table->foreignid("resource_category_id")->constrained("resource_categories", "id");
});
}

View File

@ -21,7 +21,7 @@ class CreateResource extends Migration
$table->unsignedInteger("extension_id");
$table->timestamps();
$table->foreign("extension_id")->references("id")->on("resource_extensions");
$table->foreignid("extension_id")->constrained("resource_extensions", "id");
});
}

View File

@ -20,8 +20,8 @@ class CreateUserEventsTable extends Migration
$table->timestamps();
$table->foreign("user_id")->references("id")->on("users");
$table->foreign("event_id")->references("id")->on("events");
$table->foreignid("user_id")->constrained("users", "id");
$table->foreignid("event_id")->constrained("events", "id");
});
}