app/Http/Controllers/API/TranhinhController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index($nhanvat_id)
    {
        $nhanvat = Nhanvat::find($nhanvat_id);
        $tranhinhs = $nhanvat->tranhinhs();
        return $tranhinhs;
    }
public function index ( $ nhanvat_id ) { $ nhanvat = Nhanvat :: find ( $ nhanvat_id ) ; $ tranhinhs = $ nhanvat -> tranhinhs ( ) ; return $ tranhinhs ; }
Display a listing of the resource.
Display a listing of the resource .
// foreach ($tranhinhs as $key => $value) { //     $value->vitri = explode(",", $value->vitri); // }