-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues/43 incidents seed #44
base: develop
Are you sure you want to change the base?
Issues/43 incidents seed #44
Conversation
@claudiunicolaa could you please help with a review? |
* and only pass the following values for the var | ||
* incident_type_id when seeding the local db | ||
*/ | ||
$incident_type_ids = [1,2,3,4,5,7,8,9,11,12]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use camelCase notation ($incidentTypeIds
).
If in const DATA = [
[
'id' => 1,
'label' => 'IT_OTHER',
'code' => 'OTH',
'name' => 'Altul'
],
.....
[
'id' => 12,
'label' => 'VOTE',
'code' => 'NUM',
'name' => 'Probleme în zilele votului'
]
]; iterate over foreach (self::DATA as $datum) {
IncidentType::create($datum);
} in a static method iterate to obtain the ids public static function getIds()
{
$ids = [];
foreach (self::DATA as $datum) {
$ids[] = $datum['id'];
}
return $ids;
} and in It is just an idea. Ping me on slack (username: claudiunicolaa) if you have questions. |
Just a noob question, can we query for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hints in the comments.
It is possible to query |
* added camel case * created a variable to hold incident types * modified both seeders to use this variable as a data source
@claudiunicolaa Added a variable instead of a constant because of php constratints Sorry for the long wait! |
Fixes #43