public function run() { DB::table('manhgiays')->delete(); $manhgiay = new Manhgiay(); $manhgiay->slug = 'password'; $manhgiay->password = Hash::make('123456'); // $manhgiay->password = '******'; $manhgiay->save(); }
public function __construct(Request $request) { $this->request = $request; if (!$request->input('slug')) { return 'Please specify a \'slug\''; } $this->slug = $request->input('slug'); $this->manhgiay = Manhgiay::whereSlug($this->slug)->first(); }
public function __construct(Request $request) { $this->request = $request; $this->slug = $request->segment(1); $this->manhgiay = Manhgiay::whereSlug($this->slug)->first(); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $manhgiay = Manhgiay::firstOrCreate(['slug' => $request->segment(1)]); $manhgiay->touch(); return $next($request); }