<?php
namespace App\Http\Controllers;


use App\Http\Controllers\Controller;
use App\Models\audio_playlists;
use Illuminate\Http\Request;


class AudioBooksController extends Controller
{

    public function __construct()
    {

    }

    public function index($id){
        $playlist = audio_playlists::where('identifier',$id)->first();
        $songs = $playlist->playlist;
        return view('player',['playlist' => json_decode($songs),'title' => $playlist->title]);
    }

    public function playg($id){
        $playlist = file_get_contents('https://goodlib.teleadmin.ru/getplayg?id='.$id);
        $playlist = json_decode($playlist);
        $songs = $playlist->playlist;
        return view('player',['playlist' => json_decode($songs),'title' => $playlist->title]);
    }

}



