Guest User

Untitled

a guest
Jan 17th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. class Test extends Model
  2. {
  3. protected $fillable = [
  4. 'subject','date',
  5. ];
  6.  
  7.  
  8. public function getSubjectAttribute($value)
  9. {
  10. return ucfirst($value);
  11. }
  12. }
  13.  
  14. public function get_specific_subject($id){
  15. $subject = DB::table("subjects")
  16. ->where("id", "=", $id)
  17. ->first();
  18.  
  19. return $subject;
  20. }
  21.  
  22. $subject = new Test();
  23. $subject = $subject->get_specific_subject($subject_id);
  24. dd($subject);
Add Comment
Please, Sign In to add comment