Fields

Fields can be added to resources and represent how a resource's table column should be populated. These fields provide a way to populate the resource's database columns with data. So make sure the columns are added to the migration and migrated before adding fields in Laramanager.

class CreateEventsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('events', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->string('slug');
            $table->text('description');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('events');
    }
}

Creating a field

Navigate to resources under the "System" navigation section.

Laramanager resources page

Then click on the field list icon (). This will bring up the field list for this resource.

This page will load automatically immediately after successfully adding a new resource.

Laramanager fields list page

Next, select "Create" to add a new field.

Laramanager field create page

  • Title This is the label for the field.
  • Slug This is the exact column name in the table.
  • Validation Validation rules for this field. See the available rules in the Laravel validation documentation. Of course, custom validation rules can be used as well.
  • Is Unique Indicate if the field should have a unique value.
  • List Whether to list this column data in the table view for the resource.
  • Type What field type should be used to gather data for this field. See [/docs/field-types] for more information about field types.

Laramanager field create form filled out

After creating all your fields, they will show up in the resource's field list.

Laramanager field list populated with fields