v0.9.0 - Added individual Read more buttons on news.index
Added NewsType - To see if it's a news, menu, guide or event Added type column to News type_id & arrangement_id (Both needed to see what type (menu,guide,news,event) and arrangement(The individual types ID)) Added NewsTypeSeeder.php Fixed CSS Added & Fixed messages en/dk Fixed Editors Added routing when removing yourself from an event, on events.index
This commit is contained in:
@@ -19,6 +19,8 @@ class CreateNewsTable extends Migration
|
||||
$table->string('subname');
|
||||
$table->text("content");
|
||||
$table->foreignId('resource_id')->nullable()->constrained('resources', 'id');
|
||||
$table->integer("arrangement_id")->nullable(); //Gets ID from given event, menu, guide or news
|
||||
$table->foreignid("type_id")->nullable()->constrained("news_types", "id");
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateNewsType extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('news_types', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string("type");
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('news_types');
|
||||
}
|
||||
}
|
||||
@@ -16,5 +16,6 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(UserSeeder::class);
|
||||
$this->call(ContactSeeder::class);
|
||||
$this->call(LocationSeeder::class);
|
||||
$this->call(NewsTypeSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class NewsTypeSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$newstypedata = [
|
||||
[
|
||||
'type' => "News",
|
||||
],
|
||||
[
|
||||
'type' => "Menu",
|
||||
],
|
||||
[
|
||||
'type' => "Activity",
|
||||
],
|
||||
[
|
||||
'type' => "Guide",
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($newstypedata as $data) {
|
||||
$newsType = new \App\NewsType();
|
||||
|
||||
$newsType->type = $data["type"];
|
||||
|
||||
$newsType->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user