Maybe many of the new kids who applied at Konnco Studio are a little confused about how to write laravel code at Konnco Studio, so please read this document carefully.
Always use camel case to write variables
$order_detail; // BIG NO!
$OrderDetail; // BIG NO!
$orderDetail; // BIG NO!
Jika kamu sering menggunakan suatu filter sebagai contoh status publish kamu bisa menambahkan scope publish pada modelmu, sebagai contoh :
Class Post extends Model {
public function scopeWherePublished($query){
return $query->where('status','PUBLISHED');
}
}
$post = Post::wherePublished()->get();
Always use the import class, to make it easier for the IDE to identify files, and also make it easier for you to open the controller in use.
Route::resource('payment', OrderApiController::class]);
Route::get('payment', [OrderApiController::class, 'index']);