Merhaba ,
Sitemde arka planda resim dosyalarını eklemek için redactor.js kullanıyorum. Bu sayede aşağıdaki fonksiyon ile drag and drop resim yükleyebiliyorum. bu link sitede ve editör içinde görünüyor. Fakat resimleri açıklama yazılarını giremiyorum.
public function postImage($blogId)
{
$file = Input::file('file');
$fileName = $file->getClientOriginalName();
$path = base_path().'/public/uploads/img/posts/'.$blogId.'/';
if (!is_dir($path)) {
// dir doesn't exist, make it
mkdir($path,0777);
}
$file->move($path,$fileName);
$image = new Image;
//$image->name = $fileName;
$image->name = $fileName;
$image->post_id = $blogId;
$image->save();
// resizing an uploaded file
$link = '/uploads/img/posts/'.$blogId.'/'.$image->name;
$array = array(
'filelink' => $link
);
echo stripslashes(json_encode($array));
}
{{ $image->description }} için ne yapabilirim?