Answer the question
In order to leave comments, you need to log in
Product $product_id returns empty array Laravel 5.3?
This controller
entry works with a bang (Laravel 5.3):
public function edit($product_id)
{
return $product = Product::find( $product_id );
}
public function edit(Product $product_id)
{
return $product_id;
}
Route::get( 'product/{id}/edit', '[email protected]' );
Product {#316 ▼
#table: "products"
#primaryKey: "product_id"
#fillable: array:18 [▶]
#hidden: []
#connection: null
#keyType: "int"
#perPage: 15
+incrementing: true
+timestamps: true
#attributes: []
#original: []
#relations: []
#visible: []
#appends: []
#guarded: array:1 [▶]
#dates: []
#dateFormat: null
#casts: []
#touches: []
#observables: []
#with: []
+exists: false
+wasRecentlyCreated: false
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question