app/Http/Controllers/Admin/CategoryController.php
/**
	 * Store a newly created resource in storage.
	 *
	 * @param  Request  $request
	 * @return Response
	 */
Store a newly created resource in storage.
@param  Request  $request
@return Response
Store a newly created resource in storage . @param Request $request @return Response
public function store(Request $request) {
		$cat_name = $request->cat_name;
		$cat_url = str_slug($cat_name);
		$category = Category::create([
			'cat_name' => $request->cat_name,
			'cat_status' => $request->cat_status,
			'cat_url' => $cat_url,
		]);
		return $category;
	}
public function store ( Request $ request ) { $ cat_name = $ request -> cat_name ; $ cat_url = str_slug ( $ cat_name ) ; $ category = Category :: create ( [ 'cat_name' => $ request -> cat_name , 'cat_status' => $ request -> cat_status , 'cat_url' => $ cat_url , ] ) ; return $ category ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
/* Xử lý chuỗi (bỏ dấu, thêm "-") */ /* Thêm data vào CSDL */