Beispiel #1
0
 public static function trasnlateToModels($tags)
 {
     array_walk($tags, function (&$tag) {
         $tag = Tag::firstOrCreate(['name' => $tag]);
     });
     return $tags;
 }
Beispiel #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     Category::create(['name' => 'Sitio Web']);
     Category::create(['name' => 'E-Commerce']);
     Category::create(['name' => 'API']);
     Category::create(['name' => 'Negocios']);
     Category::create(['name' => 'Open Source']);
     Category::create(['name' => 'Portafolio']);
     Category::create(['name' => 'Blog']);
     Category::create(['name' => 'Servicio al cliente']);
     Category::create(['name' => 'Agencia']);
     Category::create(['name' => 'Entretenimiento']);
     Category::create(['name' => 'Tecnología']);
     Category::create(['name' => 'Educación']);
     Category::create(['name' => 'Software como servicio']);
     Category::create(['name' => 'Servicios']);
     // create tags
     Tag::create(['name' => 'Laravel 4']);
     Tag::create(['name' => 'Laravel 5']);
     Tag::create(['name' => 'CMS']);
     Tag::create(['name' => 'PyroCMS']);
     Tag::create(['name' => 'PongoCMS']);
     Tag::create(['name' => 'Paquetes']);
     Tag::create(['name' => 'Blog']);
     Tag::create(['name' => 'Bootstrap']);
     Tag::create(['name' => 'Foundation']);
     Tag::create(['name' => 'Semantic UI']);
     Tag::create(['name' => 'API']);
 }
Beispiel #3
0
 public static function trasnlateToModels($categories)
 {
     array_walk($categories, function (&$category) {
         $category = Tag::firstOrCreate(['name' => $category]);
     });
     return $categories;
 }
 /**
  * Register any other events for your application.
  *
  * @param  \Illuminate\Contracts\Events\Dispatcher  $events
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     parent::boot($events);
     Project::observe(new SlugGeneratorObserver());
     Category::observe(new SlugGeneratorObserver());
     Tag::observe(new SlugGeneratorObserver());
 }
Beispiel #5
0
 public function getTags()
 {
     $t = new Tag();
     return $t->forSelect();
 }
 public function byTag($slug)
 {
     $tag = new Tag();
     $collection = $tag->searchByTag($slug, 'projects');
     return view('sites.index')->with('tagOn', $collection['tag'])->with('projects', $collection['collection'])->with('currentMenu', 'proyectos');
 }
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     View::composer('*', function ($view) {
         $view->with('categoriesList', Category::orderBy('name', 'asc')->get())->with('tagList', Tag::orderBy('name', 'asc'));
     });
 }