这是一个创建于 3824 天前的主题,其中的信息可能已经有所发展或是发生改变。
$photo = new photo();
$photo->title = $input['upload_title'];
$photo->slug = Str::slug($input['upload_title']);
$photo->belongs_to = $input['belongs_to'];
$photo->credits = strlen($input['credits']) > 0 ? $input['credits'] : '';
$photo->photo_url = $randomName;
$photo->type = 'image';
$photo->user_id = Auth::user()->id;
$photo->read_count = 0;
$photo->is_approved = ((int) Settings::first()->autoapprove_photos === 0) ? 0 : 1;
$photo->is_featured = 0;
$photo->save();
return Response::json(array(
'status' => 'success',
'message' => trans('app.upload_success'),
'redirect_to' => \URL::to('photo/' . Str::slug($input['upload_title']))
));