ShowsViewComposer::compose()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 7
rs 9.4286
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace WITR\ViewComposers;
4
5
use WITR\Show;
6
use Illuminate\View\View;
7
8
class ShowsViewComposer {
9
	
10
	protected $shows;
11
12
	/**
13
	 * Bind data to the view.
14
	 *
15
	 * @param  View  $view
16
	 * @return void
17
	 */
18
	public function compose(View $view)
19
	{
20
		if ($this->shows == null) {
21
			$this->shows = Show::orderBy('name', 'asc')->get();
22
		}
23
		$view->with('shows', $this->shows);
24
	}
25
}
26