AlbumsViewComposer::compose()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 5
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace WITR\ViewComposers;
4
5
use WITR\AlbumReview;
6
use Illuminate\View\View;
7
8
class AlbumsViewComposer {
9
10
	/**
11
	 * Bind data to the view.
12
	 *
13
	 * @param  View  $view
14
	 * @return void
15
	 */
16
	public function compose(View $view)
17
	{
18
		$albums = AlbumReview::orderBy('id', 'desc')->take(2)->get();
19
		$view->with('albums', $albums);
20
	}
21
}