kopia lustrzana https://github.com/pixelfed/pixelfed
				
				
				
			Update AvatarController
							rodzic
							
								
									5cec84f8e3
								
							
						
					
					
						commit
						0b9a5a26ad
					
				|  | @ -15,6 +15,7 @@ class Avatar extends Model | |||
|      * @var array | ||||
|      */ | ||||
|     protected $dates = ['deleted_at']; | ||||
|     protected $fillable = ['profile_id']; | ||||
| 
 | ||||
|     public function profile() | ||||
|     { | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ class AvatarController extends Controller | |||
|             $currentAvatar = storage_path('app/'.$profile->avatar->media_path); | ||||
|             $loc = $request->file('avatar')->storeAs($public, $name); | ||||
| 
 | ||||
|             $avatar = Avatar::whereProfileId($profile->id)->firstOrFail(); | ||||
|             $avatar = Avatar::firstOrNew(['profile_id' => $profile->id]); | ||||
|             $opath = $avatar->media_path; | ||||
|             $avatar->media_path = "$public/$name"; | ||||
|             $avatar->thumb_path = null; | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Daniel Supernault
						Daniel Supernault