本文整理汇总了PHP中Tag::whereSlug方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::whereSlug方法的具体用法?PHP Tag::whereSlug怎么用?PHP Tag::whereSlug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tag
的用法示例。
在下文中一共展示了Tag::whereSlug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAjaxTag
/**
* @return mixed
*/
public function getAjaxTag()
{
$value = Tag::whereSlug($_GET['tag_id'])->first()->toJson();
return $value;
}
示例2: getProduct
/**
* @param $slug
* @return mixed
*/
public static function getProduct($slug)
{
$value = Tag::whereSlug($slug)->first();
return Product::whereTag_id($value['id'])->get();
}
示例3: newProduct
/**
* [newProduct description]
* @param [type] $slug [description]
* @return [type] [description]
*/
public function newProduct($slug)
{
$data['tag_id'] = Tag::whereSlug($slug)->first();
$manufactures = Manufacture::all();
foreach ($manufactures as $manufacture) {
$mf[$manufacture->id] = $manufacture->name;
}
$data['content_header'] = "Add New " . ucfirst($slug) . " Product";
$data['url'] = URL::route('product.new.save', $slug);
$data['submit'] = "Add New Product";
$data['manufacture'] = $mf;
return View::make('admin.product.new', $data);
}
示例4: function
<?php
Route::bind('posts', function ($value, $route) {
return Post::whereSlug($value)->firstOrFail();
});
Route::bind('series', function ($value, $route) {
return Series::whereSlug($value)->firstOrFail();
});
Route::bind('tags', function ($value, $route) {
return Tag::whereSlug($value)->firstOrFail();
});
Route::bind('projects', function ($value, $route) {
return Project::whereSlug($value)->firstOrFail();
});
Route::model('users', 'User');
示例5: doEdit
public static function doEdit($array)
{
$update = Tag::whereSlug($array['tag_edit_slug'])->update(array('name' => $array['name'], 'template' => $array['template'], 'slug' => Str::slug($array['name'])));
return;
}