Skip to content

Commit d07dadb

Browse files
author
jsalzano92
committed
fixed createPost
1 parent 57a9407 commit d07dadb

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed

app/Http/Controllers/PostController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ public function createPost(request $request)
1212
$post->title = $request['title'];
1313
$post->summary = $request['summary'];
1414
$post->info = $request['info'];
15-
$post->posting_project = $request->id;
15+
$post->posting_project = $request['project_id'];
1616
$post->save();
17-
return redirect('/project/'.$request->id);
17+
return redirect('/project/'.$request['project_id']);
1818
}
1919

2020
public function post($id) {

composer.lock

Lines changed: 23 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/views/project_admin.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
</div>
112112
<button type="submit" class="btn btn-primary">Create Post</button>
113113
<input type="hidden" value="{{ Session::token() }}" name="_token">
114+
<input type="hidden" value="{{ $project->id }}" name="project_id">
114115
{{ csrf_field() }}
115116
</form>
116117
</div>

0 commit comments

Comments
 (0)