示例#1
0
 public function LastTabs()
 {
     $LastTenTabs = Song_data::orderBy('created_at', 'desc')->paginate(7);
     $LastTenTabs->setPath('laravel/public/lasttabs/');
     $title1 = 'Last';
     $title = 'Tabs';
     return view('infoSongDisplayer')->with('LastTenTabs', $LastTenTabs)->with('title1', $title)->with('title', $title);
 }
 public function searchFullText()
 {
     $parameterName = \Input::get('parameterName');
     $title = $parameterName;
     $title1 = 'Search';
     $parameterField = Song_data::whereRaw("MATCH(song, artist, album) AGAINST(? IN BOOLEAN MODE)", [$parameterName])->paginate(10);
     $url = URL::full();
     $parameterField->setPath($url);
     $LastTenTabs = $parameterField;
     return view('infoSongDisplayer')->with("LastTenTabs", $LastTenTabs)->with('title', $title)->with('title1', $title1);
 }
    public function run()
    {
        \DB::table('song_datas')->delete();
        Song_data::create(['song' => 'Example', 'album' => 'Example', 'artist' => 'Example', 'difficulty' => 'Novice', 'view' => 'Specify the tuning, example:
Tuning: Standard(ADGCEA)
Instructions: copy and paste the segment below as much as you need to write a fingerpicking part.
Example:         
e|--------------------------------------------------------------------------|
B|-----------5-------------7-------------5----8----7----5/7--7---------|
G|--------5-------------7-------------5-------9----7----5/7--7---------|
D|-----5-------------7-------------5--------------------------------------|
A|----------------5--------------------------------------------------------|
E|--5---------------------------5------------------------------------------|

"Insert some lyrics here."

If you want to write some part with chords, just put it over the lyrics, like this:
-G-     -B-     -Em-             -F-       -F#-
bla bla.... blablablaa... bla...........yeah

Put the chords between "-" and "-" without cuotes for a correct display.

So you are ready now! Try it!']);
    }
 public function voteTabDown($id)
 {
     $t = Song_data::findOrFail($id);
     $idUser = \Auth::user()->id;
     var_dump($id);
     var_dump($idUser);
     $checkVote = Vote::where('votable_id', $id)->where('user_id', $idUser)->where('votable_type', 'App\\Song_data')->get();
     if ($checkVote->isEmpty()) {
         $v = new Vote();
         $v->vote = -1;
         $v->user()->associate(\Auth::user());
         $v->votable_id = $id;
         $v->votable_type = "App\\Song_data";
         $v->save();
     } else {
         $checkVote = Vote::where('votable_id', $id)->where('user_id', $idUser)->where('votable_type', 'App\\Song_data')->where('vote', 1)->first();
         $checkVote->vote = -1;
         $checkVote->save();
     }
 }