I have a Model Named Lesson
like this :
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Lesson extends Model
{
use SoftDeletes;
public $primaryKey = 'lesson_id';
protected $dates = ['deleted_at', 'start_date', 'end_date'];
protected $guarded = [
'lesson_id', 'created_at', 'updated_at', 'deleted_at'
];
protected $appends = ['start_date_picker', 'end_date_picker'];
}
And in LessonController
show() method, I send an Instance of that model to a view named lesson-show
as a variable named $lesson
.
Now I want a property or method to get name of that model in lesson-show
views so that when called it, return a string like App\\Lesson
, means along with Class namespace.
Is there any method or property to do that ?
我不知道你为什么想要这个,但仍然:
dd(get_class($lesson));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.