1: <?php
2:
3: namespace App;
4:
5: use Illuminate\Database\Eloquent\Model;
6: use Illuminate\Support\Facades\DB;
7:
8: class Newspaper extends Model
9: {
10: /**
11: * The database table used by the model.
12: *
13: * @var string
14: */
15: protected $table = 'newspaper';
16:
17:
18: /**
19: * The attributes that are mass assignable.
20: *
21: * @var array
22: */
23: protected $fillable = [
24: 'name',
25: 'link',
26: 'logo'
27: ];
28:
29: public static function uploadPicture($id, $img)
30: {
31: DB::table('newspaper')
32: ->where('id', $id)
33: ->update(['logo' => $img]);
34: }
35: }
36: