So far this is the best solution (still an ugly hack!)
$tags = $request->input('tag_list');
$company->tags()->sync($tags <> null ? $tags : []);
input
method has a second argument -- default value, so you can reduce that code to one line:
$company->tags()->sync($request->input('tag_list', []));
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community