Compare commits
	
		
			No commits in common. "2394536d976a70d4852abe4014a5e96c020cb280" and "11c038d492b7d73ee7c82f919e95a9b8c1008ea3" have entirely different histories.
		
	
	
		
			2394536d97
			...
			11c038d492
		
	
		
|  | @ -6,7 +6,7 @@ | |||
| use App\Http\Controllers\Controller; | ||||
| 
 | ||||
| 
 | ||||
| class CaesarController extends Controller | ||||
| class IndexController extends Controller | ||||
| { | ||||
|     public function index() | ||||
|     { | ||||
|  | @ -1,18 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use Illuminate\Http\Request; | ||||
| use App\Models\Link; | ||||
| 
 | ||||
| class LinksController extends Controller | ||||
| { | ||||
|     public function index(){ | ||||
|         return $this->getAll(); | ||||
|     } | ||||
| 
 | ||||
|     public function getAll(){ | ||||
|         $links = new Link(); | ||||
|         return $links->all(); | ||||
|     } | ||||
| } | ||||
|  | @ -1,29 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Http\Controllers; | ||||
| 
 | ||||
| use Illuminate\Http\Request; | ||||
| use App\Models\Weekdays; | ||||
| use App\Models\Game; | ||||
| use App\Models\Schedule; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| 
 | ||||
| class SchedulesController extends Controller | ||||
| { | ||||
|     public function index(){ | ||||
|         $finalSchedules = DB::table('schedules') | ||||
|             ->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; | ||||
|     } | ||||
| } | ||||
|  | @ -1,11 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Game extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| } | ||||
|  | @ -1,11 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Link extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| } | ||||
|  | @ -1,11 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Schedule extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| } | ||||
|  | @ -1,11 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| namespace App\Models; | ||||
| 
 | ||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||
| use Illuminate\Database\Eloquent\Model; | ||||
| 
 | ||||
| class Weekdays extends Model | ||||
| { | ||||
|     use HasFactory; | ||||
| } | ||||
|  | @ -1,29 +0,0 @@ | |||
| <?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('links', function (Blueprint $table) { | ||||
|             $table->id('link_id'); | ||||
|             $table->text("link_name"); | ||||
|             $table->text("link"); | ||||
|             $table->text("image"); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Reverse the migrations. | ||||
|      */ | ||||
|     public function down(): void | ||||
|     { | ||||
|         Schema::dropIfExists('links'); | ||||
|     } | ||||
| }; | ||||
|  | @ -1,28 +0,0 @@ | |||
| <?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('weekdays', function (Blueprint $table) { | ||||
|             $table->id("weekday_id"); | ||||
|             $table->text("weekday_name"); | ||||
|             $table->date("current_date"); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Reverse the migrations. | ||||
|      */ | ||||
|     public function down(): void | ||||
|     { | ||||
|         Schema::dropIfExists('weekdays'); | ||||
|     } | ||||
| }; | ||||
|  | @ -1,27 +0,0 @@ | |||
| <?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('games', function (Blueprint $table) { | ||||
|             $table->id("game_id"); | ||||
|             $table->text("name"); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Reverse the migrations. | ||||
|      */ | ||||
|     public function down(): void | ||||
|     { | ||||
|         Schema::dropIfExists('games'); | ||||
|     } | ||||
| }; | ||||
|  | @ -1,33 +0,0 @@ | |||
| <?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('schedules', function (Blueprint $table) { | ||||
|             $table->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'); | ||||
|     } | ||||
| }; | ||||
|  | @ -3,8 +3,7 @@ | |||
|     "type": "module", | ||||
|     "scripts": { | ||||
|         "dev": "vite", | ||||
|         "build": "vite build", | ||||
|         "lara": "vite build && php artisan serve" | ||||
|         "build": "vite build" | ||||
|     }, | ||||
|     "devDependencies": { | ||||
|         "@vitejs/plugin-vue": "^5.0.3", | ||||
|  |  | |||
|  | @ -1,91 +0,0 @@ | |||
| <template> | ||||
|     <v-sheet class="bg-gradient h-100 w-100 d-flex justify-center"> | ||||
|         <v-sheet class="mt-5 mb-5 rounded-lg w-75"> | ||||
|             <p class="text-h3 ma-5">Расписание стримов</p> | ||||
|             <p class="ma-5 text-h4">{{ parseDate(dates[0].current_date) }} - {{ parseDate(dates[1].current_date) }}</p> | ||||
|             <div class="w-100 d-flex justify-center"> | ||||
|                 <v-table class="text-h5 w-66"> | ||||
|                     <tbody> | ||||
|                     <tr v-for="schedule in schedules"> | ||||
|                         <td>{{ parseDate(schedule.current_date) }} {{ schedule.weekday_name }} {{ schedule.stream_time }}</td> | ||||
|                         <td>{{ schedule.name }}</td> | ||||
|                     </tr> | ||||
|                     </tbody> | ||||
|                 </v-table> | ||||
|             </div> | ||||
|             <p class="text-h3 ma-5">Ссылочки</p> | ||||
|             <div class="w-100 d-flex justify-center"> | ||||
|                 <v-list class="w-66"> | ||||
|                     <v-list-item class="ma-5 bg-gradient-noh" elevation="6" v-for="link in links" :href="link.link"> <!-- style="background-color: #E57373; color: #FFFFFF" --> | ||||
|                         <template v-slot:prepend> | ||||
|                             <v-avatar :image="link.image" rounded="0"></v-avatar> | ||||
|                         </template> | ||||
|                         <v-list-item-title>{{ link.link_name }}</v-list-item-title> | ||||
|                     </v-list-item> | ||||
|                 </v-list> | ||||
|             </div> | ||||
|             <!-- | ||||
| 
 | ||||
|             --> | ||||
|         </v-sheet> | ||||
|     </v-sheet> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| import axios from "axios"; | ||||
| 
 | ||||
| export default { | ||||
|     name: "Schedule", | ||||
|     data: () => ({ | ||||
|         links: [], | ||||
|         schedules: [], | ||||
|         dates: [] | ||||
|     }), | ||||
|     methods: { | ||||
|         parseDate(date){ | ||||
|             let dateArr = date.split("-"); | ||||
|             return dateArr[2] + "." + dateArr[1]; | ||||
|         } | ||||
|     }, | ||||
|     mounted() { | ||||
|         axios | ||||
|             .get('/api/v1/links') | ||||
|             .then(response => (this.links = response.data)); | ||||
|         axios | ||||
|             .get('/api/v1/schedules') | ||||
|             .then(response => (this.schedules = response.data)); | ||||
|         axios | ||||
|             .get('/api/v1/dates') | ||||
|             .then(response => (this.dates = response.data)); | ||||
|     } | ||||
| } | ||||
| </script> | ||||
| 
 | ||||
| <style scoped> | ||||
| 
 | ||||
| .bg-gradient { | ||||
|     background: linear-gradient(-45deg, #f103b0, #f0a068, #4fdbfeff); | ||||
|     background-size: 200% 200%; | ||||
|     animation: gradient 15s ease infinite; | ||||
|     height: 100vh; | ||||
| } | ||||
| 
 | ||||
| .bg-gradient-noh { | ||||
|     background: linear-gradient(-45deg, #f103b0, #f0a068, #4fdbfeff); | ||||
|     background-size: 200% 200%; | ||||
|     animation: gradient 15s ease infinite; | ||||
| } | ||||
| 
 | ||||
| @keyframes gradient { | ||||
|     0% { | ||||
|         background-position: 0 50%; | ||||
|     } | ||||
|     50% { | ||||
|         background-position: 100% 50%; | ||||
|     } | ||||
|     100% { | ||||
|         background-position: 0 50%; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| </style> | ||||
|  | @ -1,15 +1,15 @@ | |||
| <template> | ||||
|     <v-app> | ||||
|         <Schedule></Schedule> | ||||
|         <Polyfill></Polyfill> | ||||
|     </v-app> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| import Schedule from "./Schedule.vue" | ||||
| import Polyfill from "./Polyfill.vue"; | ||||
| 
 | ||||
| export default { | ||||
|     name: "Welcome", | ||||
|     components: {Schedule} | ||||
|     components: {Polyfill} | ||||
| } | ||||
| </script> | ||||
| 
 | ||||
|  |  | |||
|  | @ -112,7 +112,7 @@ export default { | |||
| 
 | ||||
| <style scoped> | ||||
| .bg-gradient { | ||||
|     background: linear-gradient(-45deg, #f103b0, #f0a068, #4fdbfeff); | ||||
|     background: linear-gradient(-45deg, #6947ea, #ffd298, #4698bb); | ||||
|     background-size: 200% 200%; | ||||
|     animation: gradient 15s ease infinite; | ||||
|     height: 100vh; | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
| <head> | ||||
|     <meta charset="utf-8"> | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1"> | ||||
|     <title>Информация о трансляциях</title> | ||||
|     <title>Резюме</title> | ||||
|     @vite('resources/welcome.js') | ||||
|     @vite('resources/css/app.css') | ||||
| </head> | ||||
|  |  | |||
|  | @ -14,7 +14,4 @@ | |||
| | | ||||
| */ | ||||
| 
 | ||||
| Route::get('/', 'App\Http\Controllers\Api\V1\CaesarController@index')->name('caesar'); | ||||
| Route::get('/links', 'App\Http\Controllers\LinksController@index')->name('links'); | ||||
| Route::get('/schedules', 'App\Http\Controllers\SchedulesController@index')->name('schedules'); | ||||
| Route::get('/dates', 'App\Http\Controllers\SchedulesController@mmDate')->name('dates'); | ||||
| Route::get('/', 'App\Http\Controllers\Api\V1\IndexController@index')->name('caesar'); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue