@@ -17,11 +17,11 @@ |
||
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | - * @property mixed $meta_keywords |
|
| 21 | - * @property mixed $meta_description |
|
| 22 | - * @property mixed $page_js |
|
| 23 | - * @property mixed $page_css |
|
| 24 | - */ |
|
| 20 | + * @property mixed $meta_keywords |
|
| 21 | + * @property mixed $meta_description |
|
| 22 | + * @property mixed $page_js |
|
| 23 | + * @property mixed $page_css |
|
| 24 | + */ |
|
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | class Datastore{ |
@@ -13,22 +13,22 @@ |
||
| 13 | 13 | { |
| 14 | 14 | use ValidatesRequests; |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Store a newly created resource in storage. |
|
| 18 | - * |
|
| 19 | - * @param \Illuminate\Http\Request $request |
|
| 20 | - * @return \Illuminate\Http\Response |
|
| 21 | - */ |
|
| 22 | - public function store(Request $request) |
|
| 23 | - { |
|
| 24 | - $request->validate([ |
|
| 16 | + /** |
|
| 17 | + * Store a newly created resource in storage. |
|
| 18 | + * |
|
| 19 | + * @param \Illuminate\Http\Request $request |
|
| 20 | + * @return \Illuminate\Http\Response |
|
| 21 | + */ |
|
| 22 | + public function store(Request $request) |
|
| 23 | + { |
|
| 24 | + $request->validate([ |
|
| 25 | 25 | 'body'=>'required', |
| 26 | 26 | 'datastore_id' => 'required' |
| 27 | - ]); |
|
| 28 | - $input = $request->all(); |
|
| 29 | - $input['user_id'] = auth()->user()->id; |
|
| 30 | - DatastoreComments::create($input); |
|
| 31 | - return back(); |
|
| 32 | - } |
|
| 27 | + ]); |
|
| 28 | + $input = $request->all(); |
|
| 29 | + $input['user_id'] = auth()->user()->id; |
|
| 30 | + DatastoreComments::create($input); |
|
| 31 | + return back(); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | 34 | } |
| 35 | 35 | \ No newline at end of file |
@@ -9,36 +9,36 @@ |
||
| 9 | 9 | class DatastoreComments extends Model |
| 10 | 10 | { |
| 11 | 11 | |
| 12 | - use SoftDeletes; |
|
| 13 | - |
|
| 14 | - protected $dates = ['deleted_at']; |
|
| 15 | - |
|
| 16 | - /** |
|
| 17 | - * The attributes that are mass assignable. |
|
| 18 | - * |
|
| 19 | - * @var array |
|
| 20 | - */ |
|
| 21 | - protected $fillable = ['user_id', 'datastore_id', 'parent_id', 'body']; |
|
| 22 | - |
|
| 23 | - /** |
|
| 24 | - * The belongs to Relationship |
|
| 25 | - * |
|
| 26 | - * @var array |
|
| 27 | - */ |
|
| 28 | - public function user() |
|
| 29 | - { |
|
| 12 | + use SoftDeletes; |
|
| 13 | + |
|
| 14 | + protected $dates = ['deleted_at']; |
|
| 15 | + |
|
| 16 | + /** |
|
| 17 | + * The attributes that are mass assignable. |
|
| 18 | + * |
|
| 19 | + * @var array |
|
| 20 | + */ |
|
| 21 | + protected $fillable = ['user_id', 'datastore_id', 'parent_id', 'body']; |
|
| 22 | + |
|
| 23 | + /** |
|
| 24 | + * The belongs to Relationship |
|
| 25 | + * |
|
| 26 | + * @var array |
|
| 27 | + */ |
|
| 28 | + public function user() |
|
| 29 | + { |
|
| 30 | 30 | $user = config('auth.providers.users.model'); |
| 31 | - return $this->belongsTo($user); |
|
| 32 | - } |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * The has Many Relationship |
|
| 36 | - * |
|
| 37 | - * @var array |
|
| 38 | - */ |
|
| 39 | - public function replies() |
|
| 40 | - { |
|
| 41 | - return $this->hasMany(DatastoreComments::class, 'parent_id'); |
|
| 42 | - } |
|
| 31 | + return $this->belongsTo($user); |
|
| 32 | + } |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * The has Many Relationship |
|
| 36 | + * |
|
| 37 | + * @var array |
|
| 38 | + */ |
|
| 39 | + public function replies() |
|
| 40 | + { |
|
| 41 | + return $this->hasMany(DatastoreComments::class, 'parent_id'); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | } |
| 45 | 45 | \ No newline at end of file |
@@ -5,8 +5,8 @@ discard block |
||
| 5 | 5 | use Illuminate\Database\Eloquent\Model; |
| 6 | 6 | use Phpsa\Datastore\Models\Datastore as DatastoreModel; |
| 7 | 7 | /** |
| 8 | - * @property Object $item |
|
| 9 | - */ |
|
| 8 | + * @property Object $item |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | class DatastoreDatastore extends Model |
| 12 | 12 | { |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | public function parent() |
| 26 | - { |
|
| 27 | - return $this->belongsTo(DatastoreModel::class, 'datastore2_id'); |
|
| 26 | + { |
|
| 27 | + return $this->belongsTo(DatastoreModel::class, 'datastore2_id'); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function page() |