Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

329
Vistas
Laravel Backpack setting value on a field
$this->crud->addField([
        'label' => "Department",
        'type' => 'select_multiple',
        'name' => 'departments',
         // the method that defines the relationship in your Model
        'entity' => 'departments', // the method that defines the relationship in your Model
        'attribute' => 'department_name', // foreign key attribute that is shown to user
        'model' => "App\Models\DepartmentNames", // foreign key model
        'pivot' => true, // on create&update, do you need to add/delete pivot table entries?
    ]);

When I post the array 'department' is empty,

<select class="form-control" name="department[]" multiple="">
    <option value="">-</option>
    <option value="">Account Management</option>
    <option value="">Services</option>
    <option value="">Customers</option>
   <option value="">Technical</option>
</select>

The schema for departmentNames

- id
-department_name
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda