-
Notifications
You must be signed in to change notification settings - Fork 0
/
caps3'7.30.txt
143 lines (139 loc) · 4.31 KB
/
caps3'7.30.txt
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
yejojensha@a-PC MINGW64 ~/Desktop/FOLDERS/jo files/.Tuitt Bootcamp files/Laravel/friendReq_3 (master)
$ php artisan make:controller CommentsController
Controller created successfully.
yejojensha@a-PC MINGW64 ~/Desktop/FOLDERS/jo files/.Tuitt Bootcamp files/Laravel/friendReq_3 (master)
$ php artisan make:model Comment -m
Model created successfully.
Created Migration: 2017_07_29_140515_create_comments_table
yejojensha@a-PC MINGW64 ~/Desktop/FOLDERS/jo files/.Tuitt Bootcamp files/Laravel/friendReq_3 (master)
$ php artisan migrate
Migrating: 2017_07_29_140515_create_comments_table
Migrated: 2017_07_29_140515_create_comments_table
yejojensha@a-PC MINGW64 ~/Desktop/FOLDERS/jo files/.Tuitt Bootcamp files/Laravel/friendReq_3 (master)
$ php artisan tinker
Psy Shell v0.8.9 (PHP 5.6.30 GÇö cli) by Justin Hileman
>>> $post = App\Post::find(9);
=> App\Post {#709
id: 9,
user_id: 1,
what: "dfasfdsafdsf",
where: "asdfasdfsaf",
when: "2017-07-28",
caption: "adsfasfsda",
created_at: "2017-07-28 07:14:57",
updated_at: "2017-07-28 07:14:57",
imagepost: "imageUploads/1501226097.jpg",
}
>>> $post->comments
=> Illuminate\Database\Eloquent\Collection {#710
all: [
App\Comment {#101
id: 1,
post_id: 9,
user_id: 21,
body: "This is a great post!",
created_at: "2017-07-28 00:00:00",
updated_at: "2017-07-28 00:00:00",
},
],
}
>>> $post = App\Post::find(2);
=> App\Post {#712
id: 2,
user_id: 21,
what: "aq",
where: "aq",
when: "2017-07-26",
caption: "aq",
created_at: "2017-07-26 06:50:45",
updated_at: "2017-07-26 06:50:45",
imagepost: "",
}
>>> $post->comments
=> Illuminate\Database\Eloquent\Collection {#698
all: [],
}
>>> $c = App\Comment::first();
=> App\Comment {#706
id: 1,
post_id: 9,
user_id: 21,
body: "This is a great post!",
created_at: "2017-07-28 00:00:00",
updated_at: "2017-07-28 00:00:00",
}
>>> $c->post
=> null
>>> $c->post;
=> null
>>>
yejojensha@a-PC MINGW64 ~/Desktop/FOLDERS/jo files/.Tuitt Bootcamp files/Laravel/friendReq_3 (master)
$ php artisan tinker
Psy Shell v0.8.9 (PHP 5.6.30 GÇö cli) by Justin Hileman
>>> $c = App\Comment::first();
=> App\Comment {#707
id: 1,
post_id: 9,
user_id: 21,
body: "This is a great post!",
created_at: "2017-07-28 00:00:00",
updated_at: "2017-07-28 00:00:00",
}
>>> $c->post;
=> App\Post {#705
id: 9,
user_id: 1,
what: "dfasfdsafdsf",
where: "asdfasdfsaf",
when: "2017-07-28",
caption: "adsfasfsda",
created_at: "2017-07-28 07:14:57",
updated_at: "2017-07-28 07:14:57",
imagepost: "imageUploads/1501226097.jpg",
}
>>>
yejojensha@a-PC MINGW64 ~/Desktop/FOLDERS/jo files/.Tuitt Bootcamp files/Laravel/friendReq_3 (master)
$ php artisan tinker
Psy Shell v0.8.9 (PHP 5.6.30 GÇö cli) by Justin Hileman
>>> $c=App\Comment::first();
=> App\Comment {#707
id: 1,
post_id: 9,
user_id: 21,
body: "This is a great post!",
created_at: "2017-07-28 00:00:00",
updated_at: "2017-07-28 00:00:00",
}
>>> $c->user;
Illuminate\Database\QueryException with message 'SQLSTATE[42S22]: Column not fou
nd: 1054 Unknown column 'users.comment_id' in 'where clause' (SQL: select * from
`users` where `users`.`comment_id` = 1 and `users`.`comment_id` is not null)'
>>> $c->user;
Illuminate\Database\QueryException with message 'SQLSTATE[42S22]: Column not fou
nd: 1054 Unknown column 'users.comment_id' in 'where clause' (SQL: select * from
`users` where `users`.`comment_id` = 1 and `users`.`comment_id` is not null)'
>>>
yejojensha@a-PC MINGW64 ~/Desktop/FOLDERS/jo files/.Tuitt Bootcamp files/Laravel/friendReq_3 (master)
$ php artisan tinker
Psy Shell v0.8.9 (PHP 5.6.30 GÇö cli) by Justin Hileman
>>> $c=App\Comment::first();
=> App\Comment {#707
id: 1,
post_id: 9,
user_id: 21,
body: "This is a great post!",
created_at: "2017-07-28 00:00:00",
updated_at: "2017-07-28 00:00:00",
}
>>> $c->user;
=> App\User {#705
id: 21,
name: "juliecabss",
email: "julie@gmail.com",
avatar: "user/1501323475.jpg",
created_at: "2017-07-20 01:33:46",
updated_at: "2017-07-29 10:17:55",
}
>>>
yejojensha@a-PC MINGW64 ~/Desktop/FOLDERS/jo files/.Tuitt Bootcamp files/Laravel/friendReq_3 (master)
$