Initial Laravel API import
Some checks failed
continuous-integration/drone/push Build is failing

- Complete GGZ Ecademy Laravel backend application
- RESTful API for learning products, members, filters
- Authentication and authorization system
- Database migrations and seeders
- Custom CRUD generator commands
- Email notification system
- Integration with frontend applications
This commit is contained in:
Joris Slagter
2025-12-02 17:40:21 +01:00
parent 786b6b6a78
commit df155bb13d
341 changed files with 116385 additions and 2 deletions

2
database/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.sqlite
*.sqlite-journal

View File

@@ -0,0 +1,12 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\Repositories\LearningProduct;
use Faker\Generator as Faker;
$factory->define(LearningProduct::class, function (Faker $faker) {
return [
//
];
});

View File

@@ -0,0 +1,29 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\Repositories\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(User::class, function (Faker $faker) {
return [
'first_name' => $faker->firstName,
'last_name' => $faker->lastName,
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
});

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWebSocketsStatisticsEntriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('websockets_statistics_entries', function (Blueprint $table) {
$table->increments('id');
$table->string('app_id');
$table->integer('peak_connection_count');
$table->integer('websocket_message_count');
$table->integer('api_message_count');
$table->nullableTimestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('websockets_statistics_entries');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('first_name');
$table->string('last_name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamp('logged_at')->nullable();
$table->timestamp('last_login_at')->nullable();
$table->string('last_login_ip')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}

View File

@@ -0,0 +1,32 @@
<?php
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

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePersonalAccessTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('personal_access_tokens');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRolesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('roles', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('color');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('roles');
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRoleUserTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('role_user', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedInteger('user_id');
$table->unsignedInteger('role_id');
});
Schema::table('role_user', function (Blueprint $table) {
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('role_user', function (Blueprint $table) {
$table->dropForeign('role_user_user_id_foreign');
$table->dropForeign('role_user_role_id_foreign');
});
Schema::dropIfExists('role_user');
}
}

View File

@@ -0,0 +1,59 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLearningProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('learning_products', function (Blueprint $table) {
$table->increments('id');
$table->integer('parent_id')->nullable();
$table->boolean('published')->default(0);
$table->string('title')->nullable();
$table->string('code')->nullable();
$table->string('video')->nullable();
$table->string('lead_time')->nullable();
$table->string('seo_title')->nullable();
$table->string('meta_description')->nullable();
$table->string('url')->nullable();
$table->longText('short_description')->nullable();
$table->longText('learning_goals')->nullable();
$table->longText('review')->nullable();
$table->longText('certification')->nullable();
$table->longText('extra_information')->nullable();
$table->longText('target_audience')->nullable();
$table->boolean('in_the_picture')->nullable()->default(false);
$table->dateTime('in_the_picture_start', 0)->nullable();
$table->dateTime('in_the_picture_end', 0)->nullable();
$table->string('owner')->nullable();
$table->string('partner')->nullable();
$table->string('supplier')->nullable();
$table->longText('contract_agreements')->nullable();
$table->string('prognosis_members')->nullable();
$table->string('prognosis_attendees')->nullable();
$table->string('sharepoint_link')->nullable();
$table->string('support_link')->nullable();
$table->string('support_tickets_link')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('learning_products');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMediaTable extends Migration
{
public function up()
{
Schema::create('media', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('model');
$table->uuid('uuid')->nullable();
$table->string('collection_name');
$table->string('name');
$table->string('file_name');
$table->string('mime_type')->nullable();
$table->string('disk');
$table->string('conversions_disk')->nullable();
$table->unsignedBigInteger('size');
$table->json('manipulations');
$table->json('custom_properties');
$table->json('responsive_images');
$table->unsignedInteger('order_column')->nullable();
$table->nullableTimestamps();
});
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFiltersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('filters', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('filters');
}
}

View File

@@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateVersionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('versions', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('learning_product_id');
$table->string('version_number')->nullable();
$table->dateTime('release_start', 0)->nullable();
$table->dateTime('release_end', 0)->nullable();
$table->dateTime('release_planning_date', 0)->nullable();
$table->longText('release_planning_description')->nullable();
$table->longText('technical_information')->nullable();
$table->timestamps();
$table->softDeletes();
});
Schema::table('versions', function (Blueprint $table) {
$table->foreign('learning_product_id')->references('id')->on('learning_products');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('versions', function (Blueprint $table) {
$table->dropForeign('versions_learning_product_id_foreign');
});
Schema::dropIfExists('versions');
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFilteritemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('filter_items', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('filter_id');
$table->string('title');
$table->string('subtitle')->nullable();
$table->string('color')->nullable();
});
Schema::table('filter_items', function (Blueprint $table) {
$table->foreign('filter_id')->references('id')->on('filters');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('filter_items', function (Blueprint $table) {
$table->dropForeign('filter_items_filter_id_foreign');
});
Schema::dropIfExists('filter_items');
}
}

View File

@@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFilterItemsAssociationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('filter_items_associations', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('filter_item_id');
$table->integer('filter_items_associations_id');
$table->string('filter_items_associations_type');
$table->unique([
'filter_item_id',
'filter_items_associations_id',
'filter_items_associations_type'
], 'filter_item_id_model_id_type_unique');
$table->timestamps();
});
Schema::table('filter_items_associations', function (Blueprint $table) {
$table->foreign('filter_item_id')->references('id')->on('filter_items');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('filter_items_associations', function (Blueprint $table) {
$table->dropForeign('filter_items_associations_filter_item_id_foreign');
});
Schema::dropIfExists('filter_items_associations');
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAccreditationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('accreditations', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('learning_product_id');
$table->string('credits')->nullable();
$table->dateTime('date_start', 0)->nullable();
$table->dateTime('date_end', 0)->nullable();
$table->timestamps();
$table->softDeletes();
});
Schema::table('accreditations', function (Blueprint $table) {
$table->foreign('learning_product_id')->references('id')->on('learning_products')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('accreditations', function (Blueprint $table) {
$table->dropForeign('accreditations_learning_product_id_foreign');
});
Schema::dropIfExists('accreditations');
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCourseNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('course_notifications', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('learning_product_id');
$table->dateTime('date', 0)->nullable();
$table->string('time', 0)->nullable();
$table->string('subject')->nullable();
$table->longText('message')->nullable();
$table->json('emails');
$table->json('users');
$table->timestamps();
});
Schema::table('course_notifications', function (Blueprint $table) {
$table->foreign('learning_product_id')->references('id')->on('learning_products')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('course_notifications', function (Blueprint $table) {
$table->dropForeign('course_notifications_learning_product_id_foreign');
});
Schema::dropIfExists('course_notifications');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateChecklistCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('checklist_categories', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('checklist_categories');
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateChecklistsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('checklists', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('checklist_category_id');
$table->string('title');
$table->string('subtitle')->nullable();
});
Schema::table('checklists', function (Blueprint $table) {
$table->foreign('checklist_category_id')->references('id')->on('checklist_categories');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('checklists', function (Blueprint $table) {
$table->dropForeign('checklists_checklist_category_id_foreign');
});
Schema::dropIfExists('checklists');
}
}

View File

@@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateChecklistVersionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('checklist_versions', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('version_id');
$table->unsignedInteger('checklist_id');
$table->unsignedInteger('user_id');
$table->unique([
'version_id',
'checklist_id',
], 'checklist_id_version_id_unique');
$table->timestamps();
});
Schema::table('checklist_versions', function (Blueprint $table) {
$table->foreign('version_id')->references('id')->on('versions');
$table->foreign('checklist_id')->references('id')->on('checklists');
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('checklist_versions', function (Blueprint $table) {
$table->dropForeign('checklist_versions_version_id_foreign');
$table->dropForeign('checklist_versions_checklist_id_foreign');
$table->dropForeign('checklist_versions_user_id_foreign');
});
Schema::dropIfExists('checklist_versions');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notifications');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSynonymsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('synonyms', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('synonyms');
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLearningProductSynonym extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('learning_product_synonym', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('synonym_id');
$table->unsignedInteger('learning_product_id');
$table->unique([
'synonym_id',
'learning_product_id',
], 'synonym_id_learning_product_id_unique');
});
Schema::table('learning_product_synonym', function (Blueprint $table) {
$table->foreign('synonym_id')->references('id')->on('synonyms')->onDelete('cascade');
$table->foreign('learning_product_id')->references('id')->on('learning_products')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('learning_product_synonym', function (Blueprint $table) {
$table->dropForeign('learning_product_synonym_synonym_id_foreign');
$table->dropForeign('learning_product_synonym_learning_product_id_foreign');
});
Schema::dropIfExists('learning_product_synonym');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBranchesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('branches', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('branches');
}
}

View File

@@ -0,0 +1,71 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMembersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('members', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedInteger('branch_id')->nullable();
$table->string('type');
$table->string('informal_name')->nullable();
$table->string('formal_name')->nullable();
$table->string('kvk_number')->nullable();
$table->string('website')->nullable();
$table->string('logo')->nullable();
$table->integer('b_cp')->nullable();
$table->integer('b_cc')->nullable();
$table->integer('kg_cp')->nullable();
$table->integer('kg_cc')->nullable();
$table->integer('av_cp')->nullable();
$table->integer('av_cc')->nullable();
$table->boolean('show_on_website')->default(false);
$table->string('helpdesk_department')->nullable();
$table->string('helpdesk_contact_person')->nullable();
$table->string('helpdesk_email')->nullable();
$table->string('helpdesk_phone')->nullable();
$table->string('info_department')->nullable();
$table->string('info_contacteperson')->nullable();
$table->string('info_email')->nullable();
$table->string('info_phone')->nullable();
$table->string('info_address')->nullable();
$table->string('info_housenumber')->nullable();
$table->string('info_postal')->nullable();
$table->string('info_city')->nullable();
$table->string('info_link')->nullable();
$table->string('more_info_link')->nullable();
$table->timestamps();
$table->softDeletes();
});
Schema::table('members', function (Blueprint $table) {
$table->foreign('user_id')->references('id')->on('users');
$table->foreign('branch_id')->references('id')->on('branches');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('members', function (Blueprint $table) {
$table->dropForeign('members_user_id_foreign');
$table->dropForeign('members_branch_id_foreign');
});
Schema::dropIfExists('members');
}
}

View File

@@ -0,0 +1,51 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAddressesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('addresses', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('member_id');
$table->string('indicating')->nullable();
$table->enum('type', ['main', 'visiting', 'invoice', 'other']);
$table->string('first_name_contact_person')->nullable();
$table->string('last_name_contact_person')->nullable();
$table->string('infix')->nullable();
$table->string('email')->nullable();
$table->string('address')->nullable();
$table->string('postal')->nullable();
$table->string('phone')->nullable();
$table->string('city')->nullable();
$table->timestamps();
$table->softDeletes();
});
Schema::table('addresses', function (Blueprint $table) {
$table->foreign('member_id')->references('id')->on('members')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('addresses', function (Blueprint $table) {
$table->dropForeign('addresses_member_id_foreign');
});
Schema::dropIfExists('addresses');
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSummariesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('summaries', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('member_id');
$table->integer('year');
$table->integer('real_number_last_year')->nullable();
$table->integer('estimated_number_next_year')->nullable();
$table->unique(['member_id', 'year']);
$table->timestamps();
});
Schema::table('summaries', function (Blueprint $table) {
$table->foreign('member_id')->references('id')->on('members')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('summaries', function (Blueprint $table) {
$table->dropForeign('summaries_member_id_foreign');
});
Schema::dropIfExists('summaries');
}
}

View File

@@ -0,0 +1,59 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateContactsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('contacts', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('member_id');
$table->string('function')->nullable();
$table->string('salutation_cp')->nullable();
$table->string('initials_cp')->nullable();
$table->string('lastname_cp')->nullable();
$table->string('email_cp')->nullable();
$table->string('email2_cp')->nullable();
$table->string('phone_cp')->nullable();
$table->string('address_cp')->nullable();
$table->string('postal_cp')->nullable();
$table->string('city_cp')->nullable();
$table->string('salutation_cc')->nullable();
$table->string('initials_cc')->nullable();
$table->string('lastname_cc')->nullable();
$table->string('email_cc')->nullable();
$table->string('email2_cc')->nullable();
$table->string('phone_cc')->nullable();
$table->string('address_cc')->nullable();
$table->string('postal_cc')->nullable();
$table->string('city_cc')->nullable();
$table->timestamps();
});
Schema::table('contacts', function (Blueprint $table) {
$table->foreign('member_id')->references('id')->on('members')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('contacts', function (Blueprint $table) {
$table->dropForeign('contacts_member_id_foreign');
});
Schema::dropIfExists('contacts');
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBranchMembersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('branch_members', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('branch_id');
$table->unsignedInteger('member_id');
$table->unique([
'branch_id',
'member_id',
], 'branch_id_member_id_unique');
});
Schema::table('branch_members', function (Blueprint $table) {
$table->foreign('branch_id')->references('id')->on('branches')->onDelete('cascade');
$table->foreign('member_id')->references('id')->on('members')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('branch_members', function (Blueprint $table) {
$table->dropForeign('branch_members_branch_id_foreign');
$table->dropForeign('branch_members_member_id_foreign');
});
Schema::dropIfExists('branch_members');
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRevisionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('revisions', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('member_id')->unique();
$table->unsignedInteger('user_id');
$table->unsignedInteger('revisor_id')->nullable();
$table->json('data');
$table->timestamps();
$table->timestamp('accepted_at')->nullable();
});
Schema::table('revisions', function (Blueprint $table) {
$table->foreign('member_id')->references('id')->on('members')->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users');
$table->foreign('revisor_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('revisions', function (Blueprint $table) {
$table->dropForeign('revisions_member_id_foreign');
$table->dropForeign('revisions_user_id_foreign');
$table->dropForeign('revisions_revisor_id_foreign');
});
Schema::dropIfExists('revisions');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddQualityStandardsToLearningProducts extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('learning_products', function (Blueprint $table) {
$table->string('quality_standards')->after('target_audience')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('learning_products', function (Blueprint $table) {
$table->dropColumn('quality_standards');
});
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddMembershipFieldsToMembersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('members', function (Blueprint $table) {
$table->dateTime('start_membership', 0)->after('kvk_number')->nullable();
$table->dateTime('end_membership', 0)->after('start_membership')->nullable();
$table->string('contribution')->after('end_membership')->nullable();
$table->string('invoice_number')->after('contribution')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('members', function (Blueprint $table) {
$table->dropColumn('start_membership');
$table->dropColumn('end_membership');
$table->dropColumn('contribution');
$table->dropColumn('invoice_number');
});
}
}

View File

@@ -0,0 +1,58 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddFieldsToAddressesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('addresses', function (Blueprint $table) {
$table->string('title_contact_person')->after('last_name_contact_person')->nullable();
$table->string('initials_contact_person')->after('title_contact_person')->nullable();
$table->string('middle_name_contact_person')->after('initials_contact_person')->nullable();
$table->string('job_title_contact_person')->after('middle_name_contact_person')->nullable();
$table->string('house_number')->after('address')->nullable();
$table->string('country')->after('city')->nullable();
$table->string('title_representative')->after('country')->nullable();
$table->string('initials_representative')->after('title_representative')->nullable();
$table->string('first_name_representative')->after('initials_representative')->nullable();
$table->string('middle_name_representative')->after('first_name_representative')->nullable();
$table->string('last_name_representative')->after('middle_name_representative')->nullable();
$table->string('email_representative')->after('last_name_representative')->nullable();
$table->string('job_title_representative')->after('email_representative')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('addresses', function (Blueprint $table) {
$table->dropColumn('title_contact_person');
$table->dropColumn('initials_contact_person');
$table->dropColumn('middle_name_contact_person');
$table->dropColumn('job_title_contact_person');
$table->dropColumn('house_number');
$table->dropColumn('country');
$table->dropColumn('title_representative');
$table->dropColumn('initials_representative');
$table->dropColumn('first_name_representative');
$table->dropColumn('middle_name_representative');
$table->dropColumn('last_name_representative');
$table->dropColumn('email_representative');
$table->dropColumn('job_title_representative');
});
}
}

View File

@@ -0,0 +1,56 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddFieldsToContactsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('contacts', function (Blueprint $table) {
$table->string('firstname_cp')->after('city_cp')->nullable();
$table->string('middlename_cp')->after('firstname_cp')->nullable();
$table->string('job_title_cp')->after('middlename_cp')->nullable();
$table->string('email3_cp')->after('job_title_cp')->nullable();
$table->string('mobile_cp')->after('email3_cp')->nullable();
$table->string('house_number_cp')->after('mobile_cp')->nullable();
$table->string('firstname_cc')->after('city_cc')->nullable();
$table->string('middlename_cc')->after('firstname_cc')->nullable();
$table->string('job_title_cc')->after('middlename_cc')->nullable();
$table->string('email3_cc')->after('job_title_cc')->nullable();
$table->string('mobile_cc')->after('email3_cc')->nullable();
$table->string('house_number_cc')->after('mobile_cc')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('contacts', function (Blueprint $table) {
$table->dropColumn('firstname_cp');
$table->dropColumn('middlename_cp');
$table->dropColumn('job_title_cp');
$table->dropColumn('email3_cp');
$table->dropColumn('mobile_cp');
$table->dropColumn('house_number_cp');
$table->dropColumn('firstname_cc');
$table->dropColumn('middlename_cc');
$table->dropColumn('job_title_cc');
$table->dropColumn('email3_cc');
$table->dropColumn('mobile_cc');
$table->dropColumn('house_number_cc');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddSentToCourseNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('course_notifications', function (Blueprint $table) {
$table->boolean('sent')->after('users')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('course_notifications', function (Blueprint $table) {
$table->dropColumn('sent');
});
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}

View File

@@ -0,0 +1,57 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddApprovatedFieldToMemberChildrens extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('summaries', function (Blueprint $table) {
$table->timestamp('approved_at')->after('estimated_number_next_year')->nullable()->default(null);
$table->unsignedInteger('revisor_id')->after('estimated_number_next_year')->nullable();
$table->foreign('revisor_id')->references('id')->on('users');
});
Schema::table('contacts', function (Blueprint $table) {
$table->timestamp('approved_at')->after('house_number_cc')->nullable()->default(null);
$table->unsignedInteger('revisor_id')->after('house_number_cc')->nullable();
$table->foreign('revisor_id')->references('id')->on('users');
});
Schema::table('addresses', function (Blueprint $table) {
$table->timestamp('approved_at')->after('job_title_representative')->nullable()->default(null);
$table->unsignedInteger('revisor_id')->after('job_title_representative')->nullable();
$table->foreign('revisor_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('summaries', function (Blueprint $table) {
$table->dropColumn('approved_at');
$table->dropForeign('summaries_revisor_id_foreign');
});
Schema::table('contacts', function (Blueprint $table) {
$table->dropColumn('approved_at');
$table->dropForeign('contacts_revisor_id_foreign');
});
Schema::table('addresses', function (Blueprint $table) {
$table->dropColumn('approved_at');
$table->dropForeign('addresses_revisor_id_foreign');
});
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateManagementLinksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('management_links', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('member_id');
$table->string('title')->nullable();
$table->text('url')->nullable();
$table->enum('target', ['blank', 'self']);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('management_links');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddLinkToFilterItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('filter_items', function (Blueprint $table) {
$table->string('link')->after('color')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('filter_items', function (Blueprint $table) {
$table->dropColumn('link');
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use App\Repositories\Contact;
use Illuminate\Database\Migrations\Migration;
class RenameFunctionsInContactsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Contact::where('function', 'Bestuurders')
->update(['function' => 'Bestuurder']);
Contact::where('function', 'Klankbordgroepleden')
->update(['function' => 'Klankbordgroeplid']);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Contact::where('function', 'Bestuurder')
->update(['function' => 'Bestuurders']);
Contact::where('function', 'Klankbordgroeplid')
->update(['function' => 'Klankbordgroepleden']);
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddInfoCountryToMembersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('members', function (Blueprint $table) {
$table->string('info_country')->after('info_city')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('members', function (Blueprint $table) {
$table->dropColumn('info_country');
});
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateContributionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('contributions', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('member_id');
$table->integer('year');
$table->string('contribution')->nullable();
$table->unique(['member_id', 'year']);
$table->timestamps();
});
Schema::table('contributions', function (Blueprint $table) {
$table->foreign('member_id')->references('id')->on('members')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('summaries', function (Blueprint $table) {
$table->dropForeign('contributions_member_id_foreign');
});
Schema::dropIfExists('contributions');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddApprovatedFieldsToContributionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('contributions', function (Blueprint $table) {
$table->unsignedInteger('revisor_id')->after('contribution')->nullable();
$table->timestamp('approved_at')->after('revisor_id')->nullable()->default(null);
$table->foreign('revisor_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('contributions', function (Blueprint $table) {
$table->dropColumn('approved_at');
$table->dropForeign('contributions_revisor_id_foreign');
});
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class DeleteRepresentativeFieldsFromAddressesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('addresses', function (Blueprint $table) {
$table->dropColumn('title_representative');
$table->dropColumn('initials_representative');
$table->dropColumn('first_name_representative');
$table->dropColumn('middle_name_representative');
$table->dropColumn('last_name_representative');
$table->dropColumn('email_representative');
$table->dropColumn('job_title_representative');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('addresses', function (Blueprint $table) {
$table->string('title_representative')->after('country')->nullable();
$table->string('initials_representative')->after('title_representative')->nullable();
$table->string('first_name_representative')->after('initials_representative')->nullable();
$table->string('middle_name_representative')->after('first_name_representative')->nullable();
$table->string('last_name_representative')->after('middle_name_representative')->nullable();
$table->string('email_representative')->after('last_name_representative')->nullable();
$table->string('job_title_representative')->after('email_representative')->nullable();
});
}
}

View File

@@ -0,0 +1,57 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class AlterTypeInMembersTable extends Migration
{
const MEMBER_TYPE_ENUM_FIRST = 'A';
const MEMBER_TYPE_ENUM_LAST = 'J';
const MEMBER_TYPE_VALUE_DEFAULT = self::MEMBER_TYPE_ENUM_FIRST;
const MEMBER_TYPE_VALUE_OLD = 'ggz';
const MEMBER_TYPE_POSITION_AFTER = 'branch_id';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
/**
* We currently drop and recreate the column instead of altering it due to a limitation in doctrine/dbal.
*
* @see https://github.com/laravel/framework/issues/1186
*/
Schema::table('members', function (Blueprint $table) {
$table->dropColumn('type');
});
Schema::table('members', function (Blueprint $table) {
$enumChoices = range(self::MEMBER_TYPE_ENUM_FIRST, self::MEMBER_TYPE_ENUM_LAST);
$table->enum('type', $enumChoices)
->default(self::MEMBER_TYPE_VALUE_DEFAULT)
->after(self::MEMBER_TYPE_POSITION_AFTER);
});
DB::table('members')
->whereNull('type')
->update(['type' => self::MEMBER_TYPE_VALUE_DEFAULT]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('members', function (Blueprint $table) {
$table->string('type')->change();
});
DB::table('members')->update(['type' => self::MEMBER_TYPE_VALUE_OLD]);
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class DeleteSomeCcAndCpAddressesFieldsFromContactsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('contacts', function (Blueprint $table) {
$table->dropColumn('address_cp');
$table->dropColumn('house_number_cp');
$table->dropColumn('postal_cp');
$table->dropColumn('city_cp');
$table->dropColumn('address_cc');
$table->dropColumn('house_number_cc');
$table->dropColumn('postal_cc');
$table->dropColumn('city_cc');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('contacts', function (Blueprint $table) {
$table->string('address_cp')->nullable();
$table->string('house_number_cp')->after('mobile_cp')->nullable();
$table->string('postal_cp')->nullable();
$table->string('city_cp')->nullable();
$table->string('address_cc')->nullable();
$table->string('house_number_cc')->after('mobile_cc')->nullable();
$table->string('postal_cc')->nullable();
$table->string('city_cc')->nullable();
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAddressIdToContactsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('contacts', function (Blueprint $table) {
$table->unsignedInteger('address_id')->after('revisor_id')->nullable();
$table->foreign('address_id')->references('id')->on('addresses');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('contacts', function (Blueprint $table) {
$table->dropForeign('contacts_address_id_foreign');
});
}
}

View File

@@ -0,0 +1,81 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class DeleteAndRenameFieldsFromContactsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('contacts', function (Blueprint $table) {
// salutation and firstname are inverted because they filled salutation as firstname
// middlename and initials are inverted because they filled initials as middlename
$table->renameColumn('salutation_cp', 'firstname');
$table->renameColumn('firstname_cp', 'salutation');
$table->renameColumn('initials_cp', 'middlename');
$table->renameColumn('middlename_cp', 'initials');
$table->renameColumn('lastname_cp', 'lastname');
$table->renameColumn('email_cp', 'email');
$table->renameColumn('email2_cp', 'email2');
$table->renameColumn('phone_cp', 'phone');
$table->renameColumn('job_title_cp', 'job_title');
$table->renameColumn('email3_cp', 'email3');
$table->renameColumn('mobile_cp', 'mobile');
$table->dropColumn('salutation_cc');
$table->dropColumn('initials_cc');
$table->dropColumn('lastname_cc');
// $table->dropColumn('email_cc'); // rename to email2?
$table->dropColumn('email2_cc');
$table->dropColumn('email3_cc');
$table->dropColumn('phone_cc');
$table->dropColumn('firstname_cc');
$table->dropColumn('middlename_cc');
$table->dropColumn('job_title_cc');
$table->dropColumn('mobile_cc');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('contacts', function (Blueprint $table) {
$table->renameColumn('salutation', 'salutation_cp');
$table->renameColumn('initials', 'initials_cp');
$table->renameColumn('lastname', 'lastname_cp');
$table->renameColumn('email', 'email_cp');
$table->renameColumn('email2', 'email2_cp');
$table->renameColumn('phone', 'phone_cp');
$table->renameColumn('firstname', 'firstname_cp');
$table->renameColumn('middlename', 'middlename_cp');
$table->renameColumn('job_title', 'job_title_cp');
$table->renameColumn('email3', 'email3_cp');
$table->renameColumn('mobile', 'mobile_cp');
$table->string('salutation_cc')->nullable();
$table->string('initials_cc')->nullable();
$table->string('lastname_cc')->nullable();
// $table->string('email_cc')->nullable();
$table->string('email2_cc')->nullable();
$table->string('phone_cc')->nullable();
$table->string('firstname_cc')->nullable();
$table->string('middlename_cc')->nullable();
$table->string('job_title_cc')->nullable();
$table->string('email3_cc')->nullable();
$table->string('mobile_cc')->nullable();
});
}
}

View File

@@ -0,0 +1,58 @@
<?php
use App\Repositories\Role;
use App\Repositories\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Migrations\Migration;
class AddSuperAdminEntryToRolesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('roles', function ($table) {
$table->unique('name', 'roles_name_unique');
});
$user = User::where('email', 'kees@ggzecademy.nl')->with(['roles'])->first();
// FIXME: move elsewhere, never run right now if things are set up properly
if (!is_null($user)) {
$super_admin_role = Role::create(['name' => 'super_admin', 'color' => 'black']);
$admin_role = Role::where('name', 'admin')->first();
$operator_role = Role::where('name', 'operator')->first();
$user_role = Role::where('name', 'user')->first();
$user->roles()->sync([
$super_admin_role->id,
$admin_role->id,
$operator_role->id,
$user_role->id
]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('roles', function ($table) {
$table->dropUnique('roles_name_unique');
});
// Delete all role_user records with super admin role_id
$admin_role = Role::where('name', 'super_admin')->first();
DB::table('role_user')->where('role_id', $admin_role->id)->delete();
// Delete super admin role
$admin_role->delete();
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddForMembersToLearningProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('learning_products', function (Blueprint $table) {
$table->boolean('for_members')->after('support_tickets_link')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('learning_products', function (Blueprint $table) {
$table->dropColumn('for_members');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class MakeForMemberNullableOnLearningProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('learning_products', function (Blueprint $table) {
$table->integer('for_members')->unsigned()->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('learning_products', function (Blueprint $table) {
$table->integer('for_members')->unsigned()->nullable(false)->change();
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddThirdyPartTrainingToLearningProducts extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('learning_products', function (Blueprint $table) {
$table->boolean('third_party_training')->after('for_members')->unsigned()->nullable()->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('learning_products', function (Blueprint $table) {
$table->dropColumn('third_party_training');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddValueToEnumTypeFieldInAddresses extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('addresses', function (Blueprint $table) {
DB::statement("ALTER TABLE addresses MODIFY COLUMN type ENUM('main', 'visiting', 'invoice', 'postal', 'other')");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('addresses', function (Blueprint $table) {
DB::statement("ALTER TABLE addresses MODIFY COLUMN type ENUM('main', 'visiting', 'invoice', 'other')");
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMemberUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('member_users', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('member_id');
$table->unsignedInteger('user_id');
$table->foreign('member_id')->references('id')->on('members');
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('member_users');
}
}

View File

@@ -0,0 +1,73 @@
<?php
use App\Repositories\Member;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Webmozart\Assert\Assert;
class MigrateUserIdColumnFromMembersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
foreach (Member::all() as $member) {
$member->users()->attach($member->user_id);
}
Schema::table('members', function (Blueprint $table) {
$table->dropForeign('members_user_id_foreign');
$table->dropColumn('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
if (!Schema::hasColumn('members', 'user_id')) {
Schema::table('members', function (Blueprint $table) {
$table->unsignedInteger('user_id')->nullable()->after('id');
$table->foreign('user_id')->references('id')->on('users');
});
}
$memberUserAll = DB::table('member_users')
->select(['member_id', 'user_id'])
->get();
foreach ($memberUserAll as $memberUser) {
Assert::notNull($memberUser->user_id);
}
foreach ($memberUserAll as $memberUser) {
Member::findOrFail($memberUser->member_id)
->update(['user_id' => $memberUser->user_id]);
}
$amountMemberWithoutUser = DB::table('members')
->select('id')
->whereNull('user_id')
->count();
Assert::eq(
$amountMemberWithoutUser,
0,
sprintf(
'Found %d member(s) without an attached user, expected 0.',
$amountMemberWithoutUser,
),
);
Schema::table('members', function (Blueprint $table) {
$table->unsignedInteger('user_id')->nullable(false)->change();
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class AddUniqueIndexToMemberUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('member_users', function (Blueprint $table) {
$table->unique(['member_id', 'user_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('member_users', function (Blueprint $table) {
$table->dropForeign(['member_id']);
$table->dropForeign(['user_id']);
$table->dropUnique(['member_id', 'user_id']);
$table->foreign('member_id')->references('id')->on('members');
$table->foreign('user_id')->references('id')->on('users');
});
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterColumnsInMemberUsersTableToCascadeOnDelete extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('member_users', function (Blueprint $table) {
$table->dropForeign(['member_id']);
$table->foreign(['member_id'])
->references('id')
->on('members')
->cascadeOnDelete();
$table->dropForeign(['user_id']);
$table->foreign(['user_id'])
->references('id')
->on('users')
->cascadeOnDelete();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('member_users', function (Blueprint $table) {
$table->dropForeign(['member_id']);
$table->foreign(['member_id'])->references('id')->on('members');
$table->dropForeign(['user_id']);
$table->foreign(['user_id'])->references('id')->on('users');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddVoorOpleidersToLearningProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('learning_products', function (Blueprint $table) {
$table->boolean('voor_opleiders')->default(false)->after('third_party_training');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('learning_products', function (Blueprint $table) {
$table->dropColumn('voor_opleiders');
});
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Arr;
use App\Services\BranchService;
use Illuminate\Database\Seeder;
class BranchSeeder extends Seeder
{
private $branchService;
public function __construct(BranchService $branchService)
{
$this->branchService = $branchService;
}
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$branches = [
"Begeleid wonen",
"Forensische zorg",
"Kinder- en jeugdpsychiatrie",
"LVB-SGLVG",
"mbo's en hbo's",
"Specialistische ggz",
"Verslavingszorg",
"vLOGO",
];
foreach ($branches as $branch) {
$new_branch = $this->branchService->save(['title' => $branch]);
}
}
}

View File

@@ -0,0 +1,159 @@
<?php
use App\Services\ChecklistCategoryService;
use App\Services\ChecklistService;
use Illuminate\Support\Arr;
use Illuminate\Database\Seeder;
class ChecklistSeeder extends Seeder
{
private $checklistCategoryService;
public function __construct(
ChecklistCategoryService $checklistCategoryService,
ChecklistService $checklistService
) {
$this->checklistCategoryService = $checklistCategoryService;
$this->checklistService = $checklistService;
}
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$checklists = [
[
'title' => 'Akkoord',
'items' => [
'Inhoudelijk',
'Technisch',
'Totaal'
]
],
[
'title' => 'Oplevering ontwikkelomgeving',
'items' => [
'Statusletter aanpassen',
'Publiceren',
'Extern ID aanpassen',
'PE Online ID ingevuld',
]
],
[
'title' => 'Voor oplevering',
'items' => [
'Releasenote op support plaatsen',
'Toetsvragen beveiligen',
'Toetsvragen in productinfo op support plaatsen',
'Productinfo (incl blauwdruk) op support plaatsen ',
'Info voor catalogusproduct maken (tegeltekst n evt. toelichting)',
'Implementatie-info op support plaatsen',
'Akkoordmelding leverancier + versturen opleverdocument',
]
],
[
'title' => 'Beschikbaar stellen leden ontwikkelomgeving',
'items' => [
'Beschikbaar stellen in subomgeving van alle leden type A, B of C',
'Beschikbaar stellen in subomgeving van alle leden type E',
'Uitvoering maken en beschikbaar stellen in inkijkexemplaar',
'Uitvoering en catalogusproduct maken en beschikbaar stellen in leeromgeving voor derden',
'Beschikbaar stellen in subomgeving van leden type D en docentenomgeving',
]
],
[
'title' => 'Productcatalogus en -monitor',
'items' => [
'Productinfo plaatsen in productcatalogus',
'Verplaatsen uit In ontwikkeling',
'Controleren of de juiste informatie is doorgevoerd in de productadministratie/ op support',
'Evt. forumberichten onder Leerproducten in ontwikkeling verplaatsen',
]
],
[
'title' => 'Communicatie',
'items' => [
'CLP nieuwsflits naar beheerders van subomgevingen en medewerkers GGZ Ecademy',
'E-mail naar functioneel beheer scholen met -indien van toepassing- LTI gegevens',
'Bericht voor infomail',
'Bericht op site evt. SM',
'Bericht in nieuwsbrief',
]
],
[
'title' => 'Blauwdruk en trailer',
'items' => [
'Aangepaste blauwdruk ontvangen',
'Vragenlijst/ Voice-over trailer goedgekeurd',
'Trailer ontvangen van leverancier',
'Trailer plaatsen op mediasite',
'Trailer plaatsen in product-catalogus van website',
'Trailer plaatsen in catalogus van inkijkexemplaar in aNS',
'Trailer in product-informatie op support',
]
],
[
'title' => 'Bestandsbeheer',
'items' => [
'Opleverdocument leverancier checken',
'Ontvangen bronbestanden op de juiste plek neerzetten ',
'Catalogus- en banner afbeelding',
'SP-mappen opschonen',
'Oude, niet gepubliceerde templates archiveren (uitvoeringen einddatum instellen)',
]
],
[
'title' => 'Accreditatie',
'items' => [
'Accreditatieinfo aanvragen + op een rij zetten',
'Accreditatie-overzicht updaten',
'Accreditatie-overzicht op support zetten',
'Info over accreditatie toevoegen aan product-catalogus',
]
],
[
'title' => 'Na afloop',
'items' => [
'Terugkoppelen bevindingen naar melder',
'Afhandelen bevindingen/ tickets in FD',
'Evaluatie inplannen',
]
],
];
foreach ($checklists as $checklist) {
// Create category
$category = $this->checklistCategoryService->save(Arr::except($checklist, ['items']));
// Create checklist items to attach to that category
if (isset($checklist['items'])) {
foreach ($checklist['items'] as $item) {
$data = [];
if (is_string($item)) {
$data = [
'title' => $item,
'checklist_category_id' => $category->id
];
} elseif (Arr::isAssoc($item)) {
foreach ($item as $key => $value) {
$data[$key] = $value;
}
$data['checklist_category_id'] = $category->id;
}
$new_checklist = $this->checklistService->save($data);
}
}
}
}
}

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
// Global Importer - call separately: php artisan db:seed --class=GlobalDbImportSeeder
// $this->call(GlobalDbImportSeeder::class);
$this->call([
ChecklistSeeder::class,
RolesTableSeeder::class,
UserSeeder::class,
FilterSeeder::class,
SynonymSeeder::class,
LearningProductSeeder::class,
MemberSeeder::class
//BranchSeeder::class,
]);
}
}

View File

@@ -0,0 +1,163 @@
<?php
use Illuminate\Support\Arr;
use App\Services\FilterService;
use App\Services\FilterItemService;
use Illuminate\Database\Seeder;
class FilterSeeder extends Seeder
{
private $filterService;
public function __construct(
FilterService $filterService,
FilterItemService $filterItemService
) {
$this->filterService = $filterService;
$this->filterItemService = $filterItemService;
}
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$filters = [
[
'title' => 'category',
'items' => [
'Ambulantisering', 'Forensisch', 'Geneesmiddelen en somatiek', 'Herstel', 'Methodieken', 'Professioneel handelen', 'Professionele attitude', 'Psychopathologie', 'Suïcidepreventie', 'Voorbehouden handelingen', 'Wetgeving'
]
],
[
'title' => 'audience',
'items' => [
'Aandachtsfunctionarissen', 'Agogen', 'Ambulant begeleider', 'Artsen', 'Behandelaren', 'Cognitief gedragstherapeuten', 'Cognitief gedragstherapeutisch werkers', 'ervaringsdeskundigen', 'ervaringswerkers',
'gezondheidstherapeuten', 'groepsbegeleiders', 'groepswerkers', 'GZ psychologen', 'jongerenwerkers', 'klinisch psychologen', 'leerling verpleegkundigen', 'maatschappelijk werkers', 'orthopedagogen',
'pedagogen', 'persoonlijk begeleiders', 'physician assistants', 'POH GGZ', 'psychiaters', 'psychologen', 'psychotherapeuten', 'schuldhulpverleners', 'sociaal pedagogisch hulpverleners', 'sociaal psychiatrisch verpleegkundigen',
'social worker', 'sociotherapeuten', 'trainers', 'vaktherapeuten', 'verpleegkundig specialisten', 'verpleegkundigen', 'verzorgenden', 'woonbegeleiders', 'zorg behandel inrichtingswerkers'
]
],
[
'title' => 'format_version',
'items' => [
'option-A',
'option-B',
]
],
[
'title' => 'course',
'items' => [
'Forensische leerlijn', 'LVB', 'Zichtbaar vakmanschap'
]
],
[
'title' => 'level',
'items' => [
'MBO', 'MBO 3/4', 'MBO 4', 'HBO', 'HBO+Master', 'WO', 'NLQF 6'
]
],
[
'title' => 'developers'
],
[
'title' =>
'dev_environment',
'items' => [
'aNS'
]
],
[
'title' => 'product_type',
'items' => [
'Leertraject'
]
],
[
'title' => 'made_by',
'items' => [
'Danaë'
]
],
[
'title' => 'register',
'items' => [
'ABAN', 'Accreditatiebureau Cluster 123', 'FGZpT', 'In aanvraag', 'Kwaliteitsregister POH-GGZ', 'Kwaliteitsregister Psychotherapie NVP', 'Kwaliteitsregister V&V', 'NIP A&O | NIP A&G', 'NIP Eerstelijnspsychologen', ' NIP Kinder- en Jeugdpsycholoog (K&J) / NVO Orthopedagoog-Generalist (OG)', 'NIP-Lichaamsgericht Werkend Psycholoog', 'NIP-Neurofeedbackpsycholoog', 'NIP-Psycholoog Mediator', 'nvt', 'NVvp', 'Register Vaktherapie', 'Registerplein', 'SKJ', 'Verpleegkundig Specialisten Register', 'VVGN'
]
],
[
'title' => 'status',
'items' => [
['title' => 'Geprioriteerd', 'color' => '#19DB7A'],
['title' => 'In ontwikkeling', 'color' => '#F5AB00'],
['title' => 'Opgeleverd', 'color' => '#31B8CE'],
['title' => 'Test', 'color' => '#FFFF7E'],
['title' => 'Vervallen - actief', 'color' => '#6F7782'],
['title' => 'Vervallen - niet-actief', 'color' => '#000000'],
]
],
[
'title' => 'theme',
'items' => [
'Ambulantisering', 'Eigen regie', 'Medicatie bij psychiatrische aandoeningen', 'Meldcode Kindermishandeling en Kindcheck', 'Psychopathologie', 'Suïcidepreventie'
]
],
[
'title' => 'type',
'items' => [
[
'title' => 'GGZ-instellingen',
// 'subtitle' => 'type A,B,C'
],
[
'title' => 'Scholen',
// 'subtitle' => 'type D'
],
[
'title' => 'vLOGO onderwijs',
// 'subtitle' => 'type E'
],
'Gratis'
]
],
[
'title' => 'quality_standards',
'items' => [
'option_1',
'option_2',
'option_3',
]
],
];
foreach ($filters as $filter) {
$new_filter = $this->filterService->save(Arr::except($filter, ['items']));
if (isset($filter['items'])) {
foreach ($filter['items'] as $item) {
$data = [];
if (is_string($item)) {
$data = [
'title' => $item,
'filter_id' => $new_filter->id
];
} elseif (Arr::isAssoc($item)) {
foreach ($item as $key => $value) {
$data[$key] = $value;
}
$data['filter_id'] = $new_filter->id;
}
$new_filter_item = $this->filterItemService->save($data);
}
}
}
}
}

View File

@@ -0,0 +1,82 @@
<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class GlobalDbImportSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
/**
* Notes from last import:
*
* - json got by mysql workbench
* - sorting made manually inside the json
* - storage folder moved manually
* - media sql table imported in local from old db
* - after finished, exported the entire db and imported
*
* */
//
$db = json_decode(file_get_contents(resource_path('data/mijnggz.json')), true);
if (empty($db)) {
return;
}
$tables = array_keys($db);
$sortOrder = [
'addresses',
'checklist_categories',
'checklists',
'users',
'roles',
'role_user',
'synonyms',
'learning_products',
'versions',
'contact_persons',
'course_notifications',
'failed_jobs',
'filters',
'filter_items',
'filter_items_associations',
'learning_product_synonym',
'media',
'member_employees',
'members',
'migrations',
'notifications',
'password_resets',
'personal_access_tokens',
'websockets_statistics_entries',
'accreditations',
'checklist_versions',
];
$sortedTables = [];
$skippable = [
'migrations',
'course_notifications',
'media',
];
foreach ($db as $key => $value) {
if (!in_array($key, $skippable)) {
DB::table($key)->insert($value);
}
}
$this->call(BranchSeeder::class);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
<?php
use App\Repositories\Role;
use Illuminate\Database\Seeder;
class RolesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// Role::truncate();
Role::create(['name' => 'admin', 'color' => 'error']);
Role::create(['name' => 'operator', 'color' => 'warning']);
Role::create(['name' => 'user', 'color' => 'grey']);
Role::create(['name' => 'member', 'color' => 'blue']);
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Seeder;
use App\Services\SynonymService;
class SynonymSeeder extends Seeder
{
private $synonymService;
public function __construct(SynonymService $synonymService)
{
$this->synonymService = $synonymService;
}
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$synonyms = ['Medicijnen', 'Medicatie', 'Therapie', 'Remedie'];
foreach ($synonyms as $synonym) {
$data = ['title' => $synonym];
$this->synonymService->save($data);
}
}
}

View File

@@ -0,0 +1,170 @@
<?php
use App\Repositories\Role;
use App\Services\UserService;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use App\Notifications\CustomNotification;
class UserSeeder extends Seeder
{
private $userService;
public function __construct(UserService $userService)
{
$this->userService = $userService;
}
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// $this->userService->truncate();
// DB::table('role_user')->truncate();
$adminRole = Role::where('name', 'admin')->first();
$operatorRole = Role::where('name', 'operator')->first();
$userRole = Role::where('name', 'user')->first();
// $demo_notification = new CustomNotification('Subject', 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Ab dolores libero at dolorem unde, consequuntur sed eveniet totam aperiam aspernatur.');
$admin = factory(App\Repositories\User::class)->create([
'first_name' => 'Kees',
'last_name' => 'van de Wal',
'email' => 'kees@ggzecademy.nl',
'password' => bcrypt('password'),
]);
// $url = asset('images/kees.png');
$url = 'https://ggzecademy.nl/web/uploads/2019/02/MG_5728-kees2.jpg';
// $admin->addMediaFromUrl($url)->toMediaCollection('profile_pics');
$admin->roles()->sync([
$adminRole->id,
$operatorRole->id,
$userRole->id
]);
// $admin->notify($demo_notification);
$admin = factory(App\Repositories\User::class)->create([
'first_name' => 'Maaike',
'last_name' => 'Frumau',
'email' => 'maaike@3110.nl',
'password' => bcrypt('password'),
]);
$admin->roles()->sync([
$adminRole->id,
$operatorRole->id,
$userRole->id
]);
// $admin->notify($demo_notification);
$admin = factory(App\Repositories\User::class)->create([
'first_name' => 'Yongqing',
'last_name' => 'Wang',
'email' => 'yongqing@3110.nl',
'password' => bcrypt('password'),
]);
$admin->roles()->sync([
$adminRole->id,
$operatorRole->id,
$userRole->id
]);
// $admin->notify($demo_notification);
$admin = factory(App\Repositories\User::class)->create([
'first_name' => 'Ingrid',
'last_name' => 'Meuwissen',
'email' => 'ingridmeuwissen@ggzecademy.nl',
'password' => bcrypt('password'),
]);
$admin->roles()->sync([
$adminRole->id,
$operatorRole->id,
$userRole->id
]);
// $admin->notify($demo_notification);
$operator = factory(App\Repositories\User::class)->create([
'first_name' => 'Ingrid',
'last_name' => 'van Dijck',
'email' => 'ingridvandijck@ggzecademy.nl',
'password' => bcrypt('password'),
]);
// $operator->notify($demo_notification);
$operator->roles()->sync([
$operatorRole->id,
$userRole->id
]);
$operator = factory(App\Repositories\User::class)->create([
'first_name' => 'Margreet',
'last_name' => 'Botter',
'email' => 'margreet@ggzecademy.nl',
'password' => bcrypt('password'),
]);
// $operator->notify($demo_notification);
$operator->roles()->sync([
$operatorRole->id,
$userRole->id
]);
$operator = factory(App\Repositories\User::class)->create([
'first_name' => 'Marjolijn',
'last_name' => 'Tijsmans',
'email' => 'marjolijn@ggzecademy.nl',
'password' => bcrypt('password'),
]);
// $operator->notify($demo_notification);
$operator->roles()->sync([
$operatorRole->id,
$userRole->id
]);
$user = factory(App\Repositories\User::class)->create([
'first_name' => 'Inge',
'last_name' => 'Jansen',
'email' => 'inge@ggzecademy.nl',
'password' => bcrypt('password'),
]);
// $user->notify($demo_notification);
// $url = asset('images/inge.jpeg');
//$user->addMediaFromUrl($url)->toMediaCollection('profile_pics');
$user->roles()->sync([
$userRole->id
]);
/**
* Creates a fake user
*/
// factory(App\Repositories\User::class, 1)
// ->create()
// ->each(function ($user) use ($userRole) {
// $user->roles()->attach($userRole);
// });
}
}