|
composer create-project laravel/laravel:^8.0 VEDMOST
|
bet | 8/13 | Sana | 18.05.2024 | Hajmi | 1,95 Mb. | | #242022 |
Bog'liq YARILKASINOV ASAN ONGARBAY ULIcomposer create-project laravel/laravel:^8.0 VEDMOST
kodi kerak bo’ladi.
10-rasm
Endi terminalga kirib o’zimizga kerak model, controller, migration, request larni yaratib olamiz.
php artisan make:model Subject –all
php artisan make:model Student –all
php artisan make:model Result –all
php artisan make:model Admin --all
Endi migrationga kirib unig strukturasın ishlab chiqamiz.
2023_01_18_121821_create_subjects_table.php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSubjectsTable extends Migration
{
public function up()
{
Schema::create('subjects', function (Blueprint $table) {
$table->id();
$table->text('name');
$table->text('teacher');
$table->timestamps();}); }
public function down()
{
Schema::dropIfExists('subjects');
}}
Bizga faqat 2 column kerak bo’ladı ismi (name) va teacher (ustoz) kerak bo’ladi. Bu columnlarni yaratib olamiz. Va ularning tipin yozishimiz shart hisoblanadi. Bular ismi (name) – string (yani qator) va teacher (domla) – text qilib olamiz.
2023_01_18_121839_create_students_table.php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateStudentsTable extends Migration
{
public function up()
{
Schema::create('students', function (Blueprint $table) {
$table->id();
$table->text('fullname');
$table->text('login');
$table->text('password');
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('students');
}
}
Bizga faqat 3 column kerak bo’ladı dastur ism,familiyasi(fullname), logini(login), paroli (password) kerak bo’ladi. Bu columnlarni yaratib olamiz. Va ularning tipin yozishimiz shart hisoblanadi. Bular ism, familiayasi(fullname) – string (yani qator), logini (login) – text va paroli (password) – text qilib olamiz.
2023_01_18_121908_create_results_table.php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateResultsTable extends Migration
{
public function up()
{
Schema::create('results', function (Blueprint $table) {
$table->id();
$table->text('student_fullname');
$table->text('subject_name');
$table->boolean('status');
$table->integer('border_control');
$table->integer('final_control');
$table->integer('result');
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('results');
}
}
Bizga faqat 6ta column kerak bo’ladı. Student ism, familiyasi(fullname), fan nomi(subject_name), oraliq nazorat(border_control), yakuniy nazorat(final_control), status, natija(result) kerak bo’ladi. Bu columnlarni yaratib olamiz. Va ularning tipin yozishimiz shart hisoblanadi. Bular border_control – integer, final_control – integer, subject_name – text, fullname - text qilib olamiz.
2023_01_18_123022_create_admins_table.php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
|
| |