Fix Location parent different validation on new location creation.

This commit is contained in:
Daniel Meltzer 2020-04-28 11:27:44 -04:00
parent 82de51f23e
commit c74b904f14
No known key found for this signature in database
GPG key ID: 91C5C7B09A5B1CA0

View file

@ -67,6 +67,7 @@ class LocationsController extends Controller
{
$this->authorize('create', Location::class);
$location = new Location();
$location->id = null; // This is required to make Laravels different validation work, it errors if the parameter doesn't exist (maybe a bug)?
$location->name = $request->input('name');
$location->parent_id = $request->input('parent_id', null);
$location->currency = $request->input('currency', '$');