Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

323
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!