/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($id)
 {
     //
     $file = Files::where('id', $id)->get();
     $author = Artists::where('id', $file[0]->created_by)->get();
     $buys = Buys::where('file_id', '=', $file[0]->id)->where('buyed_by', '=', Auth::user()->id)->get();
     return view('song')->with('song', $file)->with('author', $author)->with('buys', $buys);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($id)
 {
     //
     //
     $artist = Artists::where('id', $id)->get();
     $songs = Files::where('created_by', $id)->get();
     return view('artist')->with('songs', $songs)->with('artist', $artist);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function searchForArtists($criteria)
 {
     //
     $artists = Artists::where(function ($query) use($criteria) {
         $query->where('artists.name', 'like', '%' . $criteria . '%');
     })->select('artists.*')->get();
     return $artists;
 }