Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Test extends Model
- {
- protected $fillable = [
- 'subject','date',
- ];
- public function getSubjectAttribute($value)
- {
- return ucfirst($value);
- }
- }
- public function get_specific_subject($id){
- $subject = DB::table("subjects")
- ->where("id", "=", $id)
- ->first();
- return $subject;
- }
- $subject = new Test();
- $subject = $subject->get_specific_subject($subject_id);
- dd($subject);
Add Comment
Please, Sign In to add comment