Chapter1.IntroducingLaravel In this opening chapter you’ll learn how to create and configure your Laravel project using your existing PHP development environment, a virtual machine known as Laravel Homestead, and a minimal development environment kn
保存雄辩模型时生成
该软件包提供了一个特征,当保存任何Eloquent模型时,该特征将生成唯一的段。
$ model = new EloquentModel ();
$ model -> name = 'activerecord is awesome' ;
$ model -> save ();
echo $ model -> slug ; // outputs "activerecord-is-awesome"
使用Laravels Str::slug方法生成子段,从而