Example #1
0
 /**
  * @return mixed
  */
 public function getAjaxTag()
 {
     $value = Tag::whereSlug($_GET['tag_id'])->first()->toJson();
     return $value;
 }
Example #2
0
 /**
  * @param $slug
  * @return mixed
  */
 public static function getProduct($slug)
 {
     $value = Tag::whereSlug($slug)->first();
     return Product::whereTag_id($value['id'])->get();
 }
Example #3
0
 /**
  * [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);
 }
Example #4
0
<?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');
Example #5
0
 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;
 }