merhabalar herkese
üzerinde çalışmakta olduğum bir blog sitem var yazı ekleme bölümünde yazının resmini de alacaktım bu yüzden bir symbolic link kurdum ancak yanlış kurduğunu düşünüyorum Storage/App/public/articles eklemesi gerekirken Storage/App/articles ekliyor ve public klasörünün içine ise hiç bir şey eklemiyor bunu nasıl düzeltebirilirim yardımlarınızı bekliyorum
bu benim controller im
public function store(Request $request){
$request->validate(
[
'category_id' => ['required','integer','exists:categories,id'],
'title' => 'required',
'slug' => 'unique:articles',
'image' => 'nullable|mimes:jpg,jpeg,png,webp,gif,bmp',
],
[
'title.required' => 'Başlık kısmı boş bırakılamaz.',
'image.mimes' => 'Geçersiz dosya uzantısı! Sadece (jpg,jpeg,png,webp,gif,bmp) geçerlidir.',
'category_id.required' => 'Kategori seçimi yapmadınız.',
'category_id.integer' => 'Kategori geçersiz.',
'category_id.exists' => 'Kategori geçersiz.',
]
);
$article = new Article;
$article->category_id = $request->input('category_id');
$article->user_id = $request->input('user_id');
$article->title = $request->input('title');
$article->content = $request->input('content');
if ($request->hasfile('image')) {
$file = $request->file('image');
$image = Storage::putFile('articles', new File($file->getRealPath()));
$article->image = $image;
}
$article->save();
return redirect()->route('dashboard');
bu benim filesystem dosyam
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been set up for each driver as an example of the required values.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/uploads',
'visibility' => 'public',
'throw' => false,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('uploads') => storage_path('app/public'),
],
];
bu benim .env dosyam
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:xEBZ+cUCUpbjoEp3JIMsfGud2YMhmJOIYU8xzZL7inY=
APP_DEBUG=true
APP_URL=http://kapsamlı_blog_sitem.test
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=kapsamlı_blog_sitem
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=public
QUEUE_CONNECTION=sync
SESSION_DRIVER=database
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
storage link:
The [C:\Users\galat\Desktop\kapsamlı blog sitem\kapsamlı_blog_sitem\public\uploads] link has been connected to [C:\Users\galat\Desktop\kapsamlı blog sitem\kapsamlı_blog_sitem\storage\app/public].