Skip to content

Commit

Permalink
Changes to files: Entities/ClassYear.php
Browse files Browse the repository at this point in the history
Entities/Grade.php
Entities/School.php
Entities/Subject.php
  • Loading branch information
dedanirungu committed Aug 14, 2023
1 parent 69c229b commit d2ad887
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 215 deletions.
57 changes: 4 additions & 53 deletions Entities/ClassYear.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Modules\School\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Classes\Views\FormBuilder;
use Modules\Base\Classes\Views\ListTable;
use Modules\Base\Entities\BaseModel;

class ClassYear extends BaseModel
Expand Down Expand Up @@ -37,63 +35,16 @@ class ClassYear extends BaseModel
*/
protected $table = "school_class_year";

/**
* Function for defining list of fields in table view.
*
* @return ListTable
*/
public function listTable(): ListTable
{
// listing view fields
$fields = new ListTable();

$fields->name('name')->html('text')->ordering(true);

return $fields;

}

/**
* Function for defining list of fields in form view.
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
{
// listing view fields
$fields = new FormBuilder();

$fields->name('name')->html('text')->group('w-1/2');

return $fields;

}

/**
* Function for defining list of fields in filter view.
*
* @return FormBuilder
*/
public function filter(): FormBuilder
{
// listing view fields
$fields = new FormBuilder();

$fields->name('name')->html('text')->group('w-1/6');

return $fields;

}
/**
* List of fields to be migrated to the datebase when creating or updating model during migration.
*
* @param Blueprint $table
* @return void
*/
public function migration(Blueprint $table): void
public function fields(Blueprint $table): void
{
$this->fields->increments('id');
$this->fields->string('name');
$this->fields->string('description');
$this->fields->increments('id')->html('text');
$this->fields->string('name')->html('text');
$this->fields->string('description')->html('textarea');
}
}
57 changes: 4 additions & 53 deletions Entities/Grade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Modules\School\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Classes\Views\FormBuilder;
use Modules\Base\Classes\Views\ListTable;
use Modules\Base\Entities\BaseModel;

class Grade extends BaseModel
Expand Down Expand Up @@ -37,63 +35,16 @@ class Grade extends BaseModel
*/
protected $table = "school_grade";

/**
* Function for defining list of fields in table view.
*
* @return ListTable
*/
public function listTable(): ListTable
{
// listing view fields
$fields = new ListTable();

$fields->name('name')->html('text')->ordering(true);

return $fields;

}

/**
* Function for defining list of fields in form view.
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
{
// listing view fields
$fields = new FormBuilder();

$fields->name('name')->html('text')->group('w-1/2');

return $fields;

}

/**
* Function for defining list of fields in filter view.
*
* @return FormBuilder
*/
public function filter(): FormBuilder
{
// listing view fields
$fields = new FormBuilder();

$fields->name('name')->html('text')->group('w-1/6');

return $fields;

}
/**
* List of fields to be migrated to the datebase when creating or updating model during migration.
*
* @param Blueprint $table
* @return void
*/
public function migration(Blueprint $table): void
public function fields(Blueprint $table): void
{
$this->fields->increments('id');
$this->fields->string('name');
$this->fields->string('description');
$this->fields->increments('id')->html('text');
$this->fields->string('name')->html('text');
$this->fields->string('description')->html('textarea');
}
}
60 changes: 4 additions & 56 deletions Entities/School.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Modules\School\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Classes\Views\FormBuilder;
use Modules\Base\Classes\Views\ListTable;
use Modules\Base\Entities\BaseModel;

class School extends BaseModel
Expand Down Expand Up @@ -37,66 +35,16 @@ class School extends BaseModel
*/
protected $table = "school";

/**
* Function for defining list of fields in table view.
*
* @return ListTable
*/
public function listTable(): ListTable
{
// listing view fields
$fields = new ListTable();

$fields->name('name')->html('text')->ordering(true);

return $fields;

}

/**
* Function for defining list of fields in form view.
*
* @var string
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
{
// listing view fields
$fields = new FormBuilder();

$fields->name('name')->html('text')->group('w-1/2');

return $fields;

}
/**
* Function for defining list of fields in form view.
*
* @var string
*
* @return FormBuilder
*/
public function filter(): FormBuilder
{
// listing view fields
$fields = new FormBuilder();

$fields->name('name')->html('text')->group('w-1/6');

return $fields;

}
/**
* List of fields to be migrated to the datebase when creating or updating model during migration.
*
* @param Blueprint $table
* @return void
*/
public function migration(Blueprint $table): void
public function fields(Blueprint $table): void
{
$this->fields->increments('id');
$this->fields->string('name');
$this->fields->string('description');
$this->fields->increments('id')->html('text');
$this->fields->string('name')->html('text');
$this->fields->string('description')->html('textarea');
}
}
57 changes: 4 additions & 53 deletions Entities/Subject.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Modules\School\Entities;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Classes\Views\FormBuilder;
use Modules\Base\Classes\Views\ListTable;
use Modules\Base\Entities\BaseModel;

class Subject extends BaseModel
Expand Down Expand Up @@ -37,63 +35,16 @@ class Subject extends BaseModel
*/
protected $table = "school_subject";

/**
* Function for defining list of fields in table view.
*
* @return ListTable
*/
public function listTable(): ListTable
{
// listing view fields
$fields = new ListTable();

$fields->name('name')->html('text')->ordering(true);

return $fields;

}

/**
* Function for defining list of fields in form view.
*
* @return FormBuilder
*/
public function formBuilder(): FormBuilder
{
// listing view fields
$fields = new FormBuilder();

$fields->name('name')->html('text')->group('w-1/2');

return $fields;

}

/**
* Function for defining list of fields in form view.
*
* @return FormBuilder
*/
public function filter(): FormBuilder
{
// listing view fields
$fields = new FormBuilder();

$fields->name('name')->html('text')->group('w-1/6');

return $fields;

}
/**
* List of fields to be migrated to the datebase when creating or updating model during migration.
*
* @param Blueprint $table
* @return void
*/
public function migration(Blueprint $table): void
public function fields(Blueprint $table): void
{
$this->fields->increments('id');
$this->fields->string('name');
$this->fields->string('description');
$this->fields->increments('id')->html('text');
$this->fields->string('name')->html('text');
$this->fields->string('description')->html('textarea');
}
}

0 comments on commit d2ad887

Please sign in to comment.