| Conditions | 6 |
| Paths | 32 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function saving(Post $post) |
||
| 17 | { |
||
| 18 | if (request()->filled('tags')) { |
||
| 19 | $post->tags()->sync(request('tags')); |
||
| 20 | } |
||
| 21 | |||
| 22 | if (request()->filled('category_id')) { |
||
| 23 | $post->category_id = request('category_id'); |
||
| 24 | } |
||
| 25 | |||
| 26 | if ( ! request()->filled('user_id')) { |
||
| 27 | $post->user_id = Auth::id(); |
||
| 28 | } |
||
| 29 | |||
| 30 | if ( ! request()->filled('slug')) { |
||
| 31 | $post->setSlug(request('title')); |
||
| 32 | } |
||
| 33 | |||
| 34 | if (request()->filled('status')) { |
||
| 35 | $post->setStatus(request('status')); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 54 |