diff --git a/app/Http/Controllers/Api/V1/IndexController.php b/app/Http/Controllers/Api/V1/CaesarController.php similarity index 98% rename from app/Http/Controllers/Api/V1/IndexController.php rename to app/Http/Controllers/Api/V1/CaesarController.php index 4662793..6881c73 100644 --- a/app/Http/Controllers/Api/V1/IndexController.php +++ b/app/Http/Controllers/Api/V1/CaesarController.php @@ -6,7 +6,7 @@ namespace App\Http\Controllers\Api\V1; use App\Http\Controllers\Controller; -class IndexController extends Controller +class CaesarController extends Controller { public function index() { diff --git a/app/Http/Controllers/LinksController.php b/app/Http/Controllers/LinksController.php new file mode 100644 index 0000000..145d991 --- /dev/null +++ b/app/Http/Controllers/LinksController.php @@ -0,0 +1,18 @@ +getAll(); + } + + public function getAll(){ + $links = new Link(); + return $links->all(); + } +} diff --git a/app/Http/Controllers/SchedulesController.php b/app/Http/Controllers/SchedulesController.php new file mode 100644 index 0000000..8e693e4 --- /dev/null +++ b/app/Http/Controllers/SchedulesController.php @@ -0,0 +1,29 @@ +join('weekdays', "schedules.weekday_id", "=", "weekdays.weekday_id") + ->join("games", "schedules.game_id", "=", "games.game_id") + ->select("weekdays.weekday_name", "weekdays.current_date", "games.name", "schedules.stream_time") + ->get(); + return $finalSchedules; + } + + public function mmDate(){ + $minmaxDates = DB::table("weekdays") + ->select("weekdays.current_date")->where("weekday_id", "=", 1) + ->orWhere("weekday_id", "=", 7) + ->get(); + return $minmaxDates; + } +} diff --git a/app/Models/Game.php b/app/Models/Game.php new file mode 100644 index 0000000..d18a40f --- /dev/null +++ b/app/Models/Game.php @@ -0,0 +1,11 @@ +id('link_id'); + $table->text("link_name"); + $table->text("link"); + $table->text("image"); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('links'); + } +}; diff --git a/database/migrations/2024_01_31_025117_create_weekdays_table.php b/database/migrations/2024_01_31_025117_create_weekdays_table.php new file mode 100644 index 0000000..3f285f7 --- /dev/null +++ b/database/migrations/2024_01_31_025117_create_weekdays_table.php @@ -0,0 +1,28 @@ +id("weekday_id"); + $table->text("weekday_name"); + $table->date("current_date"); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('weekdays'); + } +}; diff --git a/database/migrations/2024_01_31_025321_create_games_table.php b/database/migrations/2024_01_31_025321_create_games_table.php new file mode 100644 index 0000000..5fc729f --- /dev/null +++ b/database/migrations/2024_01_31_025321_create_games_table.php @@ -0,0 +1,27 @@ +id("game_id"); + $table->text("name"); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('games'); + } +}; diff --git a/database/migrations/2024_01_31_025427_create_schedules_table.php b/database/migrations/2024_01_31_025427_create_schedules_table.php new file mode 100644 index 0000000..cfcb0e3 --- /dev/null +++ b/database/migrations/2024_01_31_025427_create_schedules_table.php @@ -0,0 +1,33 @@ +id("schedule_id"); + $table->foreignId("weekday_id")->constrained( + table: "weekdays", column: "weekday_id", indexName: "constraint_weekday_id" + ); + $table->foreignId("game_id")->constrained( + table: "games", column: "game_id", indexName: "constraint_game_id" + ); + $table->text("stream_time"); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('schedules'); + } +}; diff --git a/package.json b/package.json index 4bfc064..0208e13 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build" + "build": "vite build", + "lara": "vite build && php artisan serve" }, "devDependencies": { "@vitejs/plugin-vue": "^5.0.3", diff --git a/public/images/twitch.png b/public/images/twitch.png new file mode 100644 index 0000000..6631e8b Binary files /dev/null and b/public/images/twitch.png differ diff --git a/resources/views/Schedule.vue b/resources/views/Schedule.vue new file mode 100644 index 0000000..23e3ef7 --- /dev/null +++ b/resources/views/Schedule.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/resources/views/Welcome.vue b/resources/views/Welcome.vue index feb368e..1c96cb0 100644 --- a/resources/views/Welcome.vue +++ b/resources/views/Welcome.vue @@ -1,15 +1,15 @@ diff --git a/resources/views/caesar/Caesar.vue b/resources/views/caesar/Caesar.vue index 635e487..390955c 100644 --- a/resources/views/caesar/Caesar.vue +++ b/resources/views/caesar/Caesar.vue @@ -112,7 +112,7 @@ export default {