added uploads to public folder
This commit is contained in:
parent
d9c2cc0c2a
commit
6b20008590
|
|
@ -4,8 +4,6 @@ namespace App\Http\Controllers\Api;
|
|||
|
||||
use App\Http\Controllers\Api\ApiController;
|
||||
use App\Models\News;
|
||||
use App\Http\Requests\StoreNewsRequest;
|
||||
use App\Http\Requests\UpdateNewsRequest;
|
||||
use App\Transformers\NewsTransformer;
|
||||
|
||||
class NewsController extends ApiController
|
||||
|
|
|
|||
|
|
@ -40,9 +40,7 @@ class TradingsController extends ApiController
|
|||
return $this->respondWithCollection($tradings, new TradingTransformer);
|
||||
}
|
||||
|
||||
public function selectedTradings(Request $request){
|
||||
$id = $request->category;
|
||||
|
||||
public function selectedTradings($id){
|
||||
if($id){
|
||||
$category = Category::with('selectedTradings')->find($id);
|
||||
if($category){
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class Document extends Model
|
|||
{
|
||||
parent::boot();
|
||||
static::deleting(function($obj) {
|
||||
\Storage::disk('public_folder')->delete($obj->image);
|
||||
\Storage::disk('uploads')->delete($obj->image);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class News extends Model
|
|||
{
|
||||
parent::boot();
|
||||
static::deleted(function($obj) {
|
||||
\Storage::disk('public_folder')->delete($obj->image);
|
||||
\Storage::disk('uploads')->delete($obj->image);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ return [
|
|||
'url' => env('AWS_URL'),
|
||||
'endpoint' => env('AWS_ENDPOINT'),
|
||||
],
|
||||
'uploads' => [
|
||||
'driver' => 'local',
|
||||
'root' => public_path('uploads')
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,6 @@ Route::get('other-filters', [FiltersController::class, 'otherFilters']);
|
|||
|
||||
Route::get('categories', [CategoryController::class, 'index']);
|
||||
Route::get('tradings', [TradingsController::class, 'index']);
|
||||
Route::get('categories/tradings', [TradingsController::class, 'selectedTradings']);
|
||||
Route::get('categories/{id}/tradings', [TradingsController::class, 'selectedTradings']);
|
||||
Route::get('news', [NewsController::class, 'index']);
|
||||
Route::get('documents', [DocumentController::class, 'index']);
|
||||
|
|
|
|||
Loading…
Reference in New Issue