-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.php
47 lines (41 loc) · 835 Bytes
/
start.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Created by PhpStorm.
* User: criativa
* Date: 24/09/15
* Time: 13:50
*/
require_once 'vendor/autoload.php';
require_once 'config/database.php';
use App\Models\Event;
require_once 'migrate.php';
$events = [
[
"dia" => "24/10",
"horario" => "9:00 ~ 12:00",
"vagas" => 300
],
[
"dia" => "24/10",
"horario" => "14:00 ~ 17:00",
"vagas" => 300
],
[
"dia" => "25/10",
"horario" => "9:00 ~ 12:00",
"vagas" => 300
],
[
"dia" => "25/10",
"horario" => "14:00 ~ 17:00",
"vagas" => 300
]
];
if(Event::all()->count() < count($events)){
createEvents($events);
}
function createEvents($events){
foreach ($events as $event) {
Event::create($event);
}
}