Hi. I have this table:
Schema::create('maps', function($table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('name');
$table->integer('coord_x');
$table->integer('coord_y');
$table->integer('coord_z');
$table->unique(['coord_x', 'coord_y', 'coord_z']);
$table->timestamps();
});
And I want to validate the uniqueness of the 3 coords. For now I have this:
public static $rules = [
'name' => ['required', 'between:3,29', 'unique:maps'],
'coord_x' => ['required', 'integer'],
'coord_y' => ['required', 'integer'],
'coord_z' => ['required', 'integer']
];
Thanks
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community