Skip to content

Commit

Permalink
wip on championship
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Jun 23, 2023
1 parent f3132ac commit 16d5145
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 78 deletions.
85 changes: 7 additions & 78 deletions app/Http/Controllers/ChampionshipController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,86 +13,15 @@ class ChampionshipController extends Controller
{
public function index()
{
$testimonials = [
[
'content' => '11111 Lorem ipsum dolor sit amet consectetur adipisicing elit. Nemo expedita voluptas culpa sapiente alias molestiae. Numquam corrupti in laborum sed rerum et corporis.',
'name' => 'Judith Black',
'job' => 'CEO',
'company' => 'Workcation',
],
[
'content' => '222222222 Lorem ipsum dolor sit amet consectetur adipisicing elit. Nemo expedita voluptas culpa sapiente alias molestiae. Numquam corrupti in laborum sed rerum et corporis.',
'name' => 'Judith Black',
'job' => 'CEO',
'company' => 'Workcation',
],
];

$links = [
[
'href' => '#',
'label' => 'Titlu Articol',
'source' => 'sursa.ro',
],
[
'href' => '#',
'label' => 'Titlu Articol',
'source' => 'sursa.ro',
],
[
'href' => '#',
'label' => 'Titlu Articol',
'source' => 'sursa.ro',
],
];

$editions = [
[
'href' => '1',
'name' => 'Campionatul de bine 2020',
],
[
'href' => '2',
'name' => 'Campionatul de bine 2019',
],
[
'href' => '3',
'name' => 'Campionatul de bine 2018',
],
];
$projects = Project::publish()->paginate(9)->withQueryString();
$counties = County::get(['name', 'id']);
$testimonials=[];
$links=[];
$editions=[];
$articles=[];

$articles = [
[
'id' => 1,
'img' => '/images/project_img.png',
'author' => 'Ion Popescu',
'name' => 'Importanța educației remediare în România în timpul pandemiei',
'team' => 'Echipa BCR',
'content' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto accusantium praesentium eius, ut atque fuga culpa, similique sequi cum eos quis dolorum.',
'date' => '15.02.2022',
],
[
'id' => 2,
'img' => '/images/project_img.png',
'author' => 'Ion Popescu',
'name' => 'Importanța educației remediare în România în timpul pandemiei',
'team' => 'Echipa BCR',
'content' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto accusantium praesentium eius, ut atque fuga culpa, similique sequi cum eos quis dolorum.',
'date' => '15.02.2022',
],
[
'id' => 3,
'img' => '/images/project_img.png',
'author' => 'Ion Popescu',
'name' => 'Importanța educației remediare în România în timpul pandemiei',
'team' => 'Echipa BCR',
'content' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto accusantium praesentium eius, ut atque fuga culpa, similique sequi cum eos quis dolorum.',
'date' => '15.02.2022',
],
];

$projects = Project::publish()->paginate(9)->withQueryString();
$counties = County::whereHas('projects')->get(['name', 'id']);

return Inertia::render('Public/Championship/Championship', [
'query' => $projects,
Expand Down Expand Up @@ -208,7 +137,7 @@ public function edition()
];

$projects = Project::publish()->paginate(9)->withQueryString();
$counties = County::whereHas('projects')->get(['name', 'id']);
$counties = County::get(['name', 'id']);

return Inertia::render('Public/Championship/Edition', [
'query' => $projects,
Expand Down
11 changes: 11 additions & 0 deletions app/Models/Championship.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Championship extends Model
{
use HasFactory;
}
11 changes: 11 additions & 0 deletions app/Models/ChampionshipDonation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ChampionshipDonation extends Model
{
use HasFactory;
}
11 changes: 11 additions & 0 deletions app/Models/ChampionshipStage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ChampionshipStage extends Model
{
use HasFactory;
}
23 changes: 23 additions & 0 deletions database/factories/ChampionshipFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Championship>
*/
class ChampionshipFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
//
];
}
}
23 changes: 23 additions & 0 deletions database/factories/ChampionshipStageFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ChampionshipStage>
*/
class ChampionshipStageFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
//
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('championships', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->text('description')->nullable()->default(null);
$table->date('start_date')->nullable()->default(null);
$table->date('end_date')->nullable()->default(null);
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('championships');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('championship_stages', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('championship_stages');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('championship_donations', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('championship_donations');
}
};

0 comments on commit 16d5145

Please sign in to comment.