The database is called: spreadsheet
Category
php artisan make: migration create_table_table
public function up() {
Schema::create('categoria', function(Blueprint $table){
$table->increments('id_categoria');
$table->decimal('costo_hora', 10, 2);
$table->timestamps();
});
}
personal
php artisan make: migration create_personal_table
public function up() {
Schema::create('personal', function (Blueprint $table) {
$table->increments('id_personal');
$table->string('paterno',50);
$table->string('materno',50);
$table->string('nombre',50);
$table->unsignedInteger('categoria_id');
$table->foreign('categoria_id')->references('id_categoria')->on('categoria')->onDelete('cascade');
$table->timestamps();
});
}
Salary
php artisan make: migration create_table_hand
public function up() {
Schema::create('sueldo', function(Blueprint $table){
$table->increments('id_sueldo');
$table->decimal('horas', 10, 2);
$table->decimal('importe', 10, 2);
$table->string('periodo');
$table->unsignedInteger('personal_id');
$table->foreign('personal_id')->references('id_personal')->on('personal')->onDelete('cascade');
$table->timestamps();
});
}