Closed destiaarti closed 4 years ago
uda solve mas, saya lihat dari https://github.com/azishapidin/indoregion/issues/10
Coba periksa $province nya pake dd($province)
On Wed, 9 Sep 2020 at 12.26 destiaarti notifications@github.com wrote:
// Get Kabupaten/Kota dari sebuah Provinsi
$regencies = $province->regencies;
controller saya:
use App\Models\Province;
use App\Models\Regency;
use App\Models\District;
use App\Models\Village;
public function regency($province)
{
$regencies = $province->regencies;
return response()->json($regencies);
}
route saya:
Route::get('/regency/{province}','RegionController@regency');
hasil :
ErrorException: Trying to get property 'regencies' of non-object in ...
itu knp ya mas @azishapidin https://github.com/azishapidin ? ada yg kurang kah, saya sudah sesuai github untuk instalasinya, saya pakai laravel 7.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/azishapidin/indoregion/issues/15, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZGPGL5TCVHMLZR3UPGJUTSE4GXXANCNFSM4RBDNWYA .
uda solve ko mas hehe, trnyata hrs manggil model dulu . jadi bentuknya objek gitu. sebelumnya saya kan manggilnya si id langsung, saya kira sama macam api lokasi rajaongkir. Jd parameternya langsung id gitu. makasii mas hehehe
// Get Kabupaten/Kota dari sebuah Provinsi $regencies = $province->regencies; controller saya: use App\Models\Province; use App\Models\Regency; use App\Models\District; use App\Models\Village; public function regency($province) { $regencies = $province->regencies; return response()->json($regencies); } route saya: Route::get('/regency/{province}','RegionController@regency');
hasil : ErrorException: Trying to get property 'regencies' of non-object in ...
itu knp ya mas @azishapidin ? ada yg kurang kah, saya sudah sesuai github untuk instalasinya, saya pakai laravel 7.