NASER fix file upload for products and return the address
This commit is contained in:
@@ -19,8 +19,8 @@ class ProductController extends SuperController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->with = ['file', 'price', 'default', 'sub'];
|
||||
$this->with = [];
|
||||
$this->with = ['file'/*, 'price', 'default', 'sub'*/];
|
||||
// $this->with = [];
|
||||
parent::__construct(Product::class, $this->with, ['*'], null, null, ['title']);
|
||||
}
|
||||
public function tableProduct(Request $request)
|
||||
|
||||
@@ -70,7 +70,7 @@ class Product extends Model
|
||||
return $this->hasOne(Wallet::class)->where('owner',auth()->user()->id);
|
||||
}
|
||||
public function file(){
|
||||
return $this->belongsTo(File::class, 'original_image_id');
|
||||
return $this->belongsTo(File::class);
|
||||
}
|
||||
public function price(){
|
||||
return $this->hasOne(Price::class)->orderBy('id','desc');
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ use \App\Http\Controllers\Admin\GiftCardController;
|
||||
Route::middleware('auth:user')->group(function (){
|
||||
Route::middleware('validation')->group(function (){
|
||||
Route::get('/p', function () {
|
||||
return Http::get('https://pricing.liman.gold/pricingApi', [])->json();
|
||||
return Http::get('http://109.122.246.48:4949/api/free', [])->json();
|
||||
});
|
||||
|
||||
//upload file
|
||||
|
||||
Reference in New Issue
Block a user