GroupComment.php 422 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. use App\Profile;
  6. class GroupComment extends Model
  7. {
  8. use HasFactory;
  9. public $guarded = [];
  10. public function profile()
  11. {
  12. return $this->belongsTo(Profile::class);
  13. }
  14. public function url()
  15. {
  16. return '/group/' . $this->group_id . '/c/' . $this->id;
  17. }
  18. }