I told you that the order of your migrations should be as follows
category
You generate the migration with the following command
php artisan make:migration create_categoria_table
public function up() {
Schema::create('categoria', function(Blueprint $table){
$table->increments('id_categoria');
$table->decimal('costo_hora', 10, 2);
$table->timestamps();
});
}
personal
You generate the migration with the following command
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
You generate the migration with the following command
php artisan make:migration create_sueldo_table
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();
});
}
CLARIFICATIONS
Migrations go one per file
The category table goes first, because it does not depend on any other to exist
staff goes after because it depends on its category structure
Salary goes to the end because its very existence depends on personal and at the same time personal depends on category
OBSERVATIONS
Foreign keys, try to name them in the following way
nombreColumna_id
user_id
also in the singular