/**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     //
     $skill = new Skill();
     // skill Model 内容
     $skill->name_jp = Input::get('name_jp');
     $skill->name_en = Input::get('name_en');
     $skill->name_cn = Input::get('name_cn');
     $skill->desc_jp = Input::get('desc_jp');
     $skill->desc_en = Input::get('desc_en');
     $skill->desc_cn = Input::get('desc_cn');
     $skill->race = Input::get('race');
     $skill->attr = Input::get('attr');
     $skill->job = Input::get('job');
     $skill->power = Input::get('power');
     $skill->power_type = Input::get('power_type');
     $skill->admin_memo = Input::get('admin_memo');
     // 原则上做成时非公开
     $skill->open = false;
     // $skill->update_datetime = now();
     if ($skill->save()) {
         return Redirect::to('skill');
     } else {
         return Redirect::back()->withInput()->withErrors('保存失败!');
     }
 }
Exemple #2
0
 public function store(Request $request, Skill $skill)
 {
     $user = Auth::user();
     //        $this->validate($request, [
     //            'title' => 'required|unique:posts|max:255',
     //            'author.name' => 'required',
     //            'author.description' => 'required',
     //        ]);
     $input = $request->all();
     $input['skill_id'] = $skill->id;
     $endorse = $user->endorses()->create($input);
     $this->stream($endorse);
     return ['hasCallback' => 1, 'callback' => 'skill_endorsed', 'hasMsg' => 0, 'msg' => '', 'returns' => $skill->endorses()->with('user')->get()];
 }
 public function deleteSkill(Request $request)
 {
     $this->validate($request, ['id' => 'exists:skills']);
     $skill = Skill::find($request->get('id'));
     $skill->delete();
     return response()->json($skill);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     for ($i = 0; $i < 300; $i++) {
         Skill::create(['name' => $faker->shuffle($faker->name()), 'description' => $faker->text(), 'icon' => $faker->imageUrl(100, 100, 'abstract')]);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Skill::create(['name' => 'HTML']);
     Skill::create(['name' => 'HTML5']);
     Skill::create(['name' => 'CSS']);
     Skill::create(['name' => 'CSS3']);
     Skill::create(['name' => 'JavaScript']);
     Skill::create(['name' => 'CoffeeScript']);
     Skill::create(['name' => 'AngularJS']);
     Skill::create(['name' => 'ReactJS']);
     Skill::create(['name' => 'PHP']);
     Skill::create(['name' => 'Doctrine']);
     Skill::create(['name' => 'Doctrine2']);
     Skill::create(['name' => 'Laravel']);
     Skill::create(['name' => 'Symfony2']);
     Skill::create(['name' => 'Java']);
     Skill::create(['name' => 'Scala']);
     Skill::create(['name' => 'Play Framework']);
     Skill::create(['name' => 'Akka']);
     Skill::create(['name' => 'Java']);
     Skill::create(['name' => 'Hibernate ORM']);
     Skill::create(['name' => 'C']);
     Skill::create(['name' => 'C++']);
     Skill::create(['name' => 'C#']);
     Skill::create(['name' => 'Python']);
     Skill::create(['name' => 'Ruby']);
     Skill::create(['name' => 'Ruby On Rails']);
     Skill::create(['name' => 'Visual Basic']);
     Skill::create(['name' => 'Matlab']);
     Skill::create(['name' => 'Rust']);
     Skill::create(['name' => 'Go']);
     Skill::create(['name' => 'SQL']);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['skill' => 'required']);
     Skill::create($request->all());
     flash()->success('Successfully Added!');
     return redirect('/admin/skills/add');
 }
 public function about()
 {
     $about = About::all();
     $skill = Skill::all();
     $data = array('about' => $about, 'skill' => $skill);
     return view('about.index', $data);
 }
 /**
  * Remove skill
  *
  * @param  int  $id
  * @return string
  */
 public function destroy($id)
 {
     $skill = Skill::find($id);
     if ($skill != null) {
         $skill->delete();
     }
     return json_encode("success");
 }
 /**
  * 玩家卡片取得处理
  */
 public function cardBox()
 {
     // 玩家ID获取
     $intPlayerId = Input::get('player_id');
     // 玩家所持卡片全取得
     $lstCard = OwnedCard::where('player_id', $intPlayerId)->get();
     return view('admin.player.card-box')->withCards(Card::all())->withAttrs(Attr::all())->withRaces(Race::all())->withJobs(Job::all())->withSkills(Skill::all())->withOwnedCards($lstCard);
 }
 public function index()
 {
     $languages = Skill::language()->orderBy('importance', 'desc')->get();
     $software = Skill::software()->orderBy('importance', 'desc')->get();
     $technical = Skill::technical()->orderBy('importance', 'desc')->get();
     $other = Skill::other()->orderBy('importance', 'desc')->get();
     return view('resume.skills', compact(['languages', 'software', 'technical', 'other']));
 }
 public function storeSkill()
 {
     $input = Request::all();
     //dd($input);
     $input['skill_type_id'] = (int) $input['skill_type_id'];
     //dd($input);
     $Skill = Skill::create($input);
     return redirect('newskill');
 }
 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     // always returns $user whether logged in or not, null if not
     view()->composer(['layouts._rightnav', 'layouts.loginForm', 'tracks.index', 'skills.create', 'level.index', 'tracks.editForm', 'levels.editForm', 'difficulties.editForm'], function ($view) {
         $view->with('user', Auth::check() ? Auth::user()->firstname : null);
     });
     view()->composer(['questions._questionform', 'skills.newform', 'skills._rowform'], function ($view) {
         $view->with(['tracks' => Track::lists('track', 'id'), 'levels' => Level::lists('description', 'id'), 'difficulties' => Difficulty::lists('difficulty', 'id'), 'skills' => Skill::lists('short_description', 'id'), 'user' => Auth::user()]);
     });
 }
Exemple #13
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     for ($i = 0; $i < 50; $i++) {
         Skill::create(['skill' => $i, 'short_description' => $faker->sentence(2), 'description' => $faker->sentence(6), 'track_id' => $faker->numberBetween(1, 4), 'level_id' => $faker->numberBetween(5, 8), 'user_id' => 2, 'status_id' => 3]);
     }
     Skill::create(['skill' => 3, 'short_description' => 'Numbers up to 100', 'description' => 'Whatever you want to describe numbers la', 'track_id' => 1, 'level_id' => 6, 'user_id' => 2, 'status_id' => 3]);
     Skill::create(['skill' => 2, 'short_description' => 'Fraction of a whole', 'description' => 'interpretation of fraction as a part of a whole, reading and writing fractions, comparing and ordering', 'track_id' => 1, 'level_id' => 7, 'user_id' => 2, 'status_id' => 3]);
     Skill::create(['skill' => 1, 'short_description' => 'Length mass and volume', 'description' => 'length in km, vol in ml, compound units, conversion from km to m, m to centimeters, kg to g, litres to ml', 'track_id' => 2, 'level_id' => 8, 'user_id' => 2, 'status_id' => 3]);
 }
Exemple #14
0
 public function addSkill()
 {
     $user = Auth::user();
     $name = Input::get('skill');
     $stars = Input::get('level');
     $skill = Skill::where('user', '=', $user->id)->where('name', '=', $name);
     if ($skill->count() > 0) {
         $skill = $skill->first();
         $rep = 'old';
     } else {
         $skill = new Skill();
         $rep = 'new';
     }
     $skill->user = $user->id;
     $skill->name = $name;
     $skill->level = $stars;
     $skill->save();
     return response()->json(array('response' => $rep, 'skill' => $skill->toArray()));
 }
Exemple #15
0
 public function compare(Request $request)
 {
     if ($request->session()->has('compare')) {
         $compare = $request->session()->get('compare');
         $skills = Skill::whereIn('id', $compare['cases'])->get();
         return view('profile.compare', compact('skills'))->with(['title' => 'مقایسه مهارت ها']);
     } else {
         return redirect(route('profile.me'));
     }
 }
Exemple #16
0
 public function skillPageJson()
 {
     $return_array = array();
     $skill = Skill::all();
     foreach ($skill as $skill) {
         $data_array['id'] = $skill->id;
         $data_array['description'] = $skill->description;
         $data_array['point'] = $skill->point;
         $data_array['category'] = $skill->category;
         array_push($return_array, $data_array);
     }
     echo json_encode($return_array);
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     if (Request::ajax()) {
         if (null == Request::all()) {
             return response()->json(['response' => 'error in skill update', 404], 404);
         } else {
             $skill = Skill::findOrFail(Request::get('pk'));
             $skill[Request::get('name')] = Request::get('value');
             $skill->update();
             return response()->json(['skill' => $skill, 200], 200);
         }
     }
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show(Request $request, Vote $votes)
 {
     $player1ID = Input::get('ddlPlayer1');
     $player2ID = Input::get('ddlPlayer2');
     $players_list = Player::orderby('last_name')->orderby('first_name')->get()->lists('last_first_name', 'player_id');
     $player1 = Player::where('player_id', '=', $player1ID)->first();
     $player2 = Player::where('player_id', '=', $player2ID)->first();
     $h2h = new Match();
     $head2head = $h2h->head2head($player1ID, $player2ID);
     $skills = Skill::orderby('skill_id')->get();
     $voter_id = \Auth::user()->id;
     return view('pages/matchups.show', compact('players_list', 'player1', 'player2', 'head2head', 'skills', 'votes', 'voter_id'));
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('skills')->delete();
     Skill::create(['skill_id' => '1', 'skill' => 'Power']);
     Skill::create(['skill_id' => '2', 'skill' => 'Control']);
     Skill::create(['skill_id' => '3', 'skill' => 'Speed']);
     Skill::create(['skill_id' => '4', 'skill' => 'Serves']);
     Skill::create(['skill_id' => '5', 'skill' => 'Returns']);
     Skill::create(['skill_id' => '6', 'skill' => 'Forehand']);
     Skill::create(['skill_id' => '7', 'skill' => 'Backhand']);
     Skill::create(['skill_id' => '8', 'skill' => 'Fitness']);
     Skill::create(['skill_id' => '9', 'skill' => 'Mental']);
     Skill::create(['skill_id' => '10', 'skill' => 'Versatility']);
 }
Exemple #20
0
 public function design()
 {
     $roles = Role::all();
     $users = User::all();
     $userroles = DB::table('role_user')->get();
     $jobstable = Job::all();
     $userjobs = Userjobs::all();
     $permissions = DB::table('permissions')->get();
     $permissionroles = DB::table('permission_role')->get();
     $skills = Skill::all();
     $jobskills = JobSkill::all();
     $userskills = UserSkill::all();
     return View('design')->withJobs($jobstable)->withJobsusers($userjobs)->withusers($users)->withroles($roles)->withuserroles($userroles)->withpermissions($permissions)->withpermissionroles($permissionroles)->withskills($skills)->withjobskills($jobskills)->withuserskills($userskills);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request, $category = 'All')
 {
     $cat = Category::where('name', $category)->first();
     $searchTerm = $request->input('searchString', '');
     $skills = Skill::InCategory($cat)->MatchingTerm($searchTerm)->orderBy('name', 'asc')->get();
     if ($request->ajax()) {
         return view('partials.skills', ['skills' => $skills]);
     }
     if ($cat != null) {
         $category = $cat->name;
     }
     $categories = array('' => 'All') + Category::lists('name', 'name')->all();
     return view('skills', ['skills' => $skills, 'categories' => $categories, 'category' => $category]);
 }
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     // bind skill, course, and project wildcards the the alias in the database.
     $router->bind('skill', function ($alias) {
         return Skill::where('alias', $alias)->firstOrFail();
     });
     $router->bind('course', function ($alias) {
         return Course::where('alias', $alias)->firstOrFail();
     });
     $router->bind('project', function ($alias) {
         return Project::where('alias', $alias)->firstOrFail();
     });
 }
 public function edit()
 {
     $user = User::findOrFail(Auth::user()->id);
     $entity = Entity::where('user_id', Auth::user()->id)->firstOrFail();
     $about = About::where('user_id', Auth::user()->id)->firstOrFail();
     $contact = Contact::where('user_id', Auth::user()->id)->firstOrFail();
     $home = Home::where('user_id', Auth::user()->id)->firstOrFail();
     $quote = Quote::where('user_id', Auth::user()->id)->get();
     $quote_count = $quote->count();
     $skill = Skill::where('user_id', Auth::user()->id)->get();
     $skill_count = $skill->count();
     $skill_slider = SkillSlider::where('user_id', Auth::user()->id)->get();
     $skill_slider_count = $skill_slider->count();
     $portfolio_piece = PortfolioPiece::where('user_id', Auth::user()->id)->get();
     $portfolio_piece_count = $portfolio_piece->count();
     return view('edit')->with('user', $user)->with('home', $home)->with('entity', $entity)->with('contact', $contact)->with('about', $about)->with('skill', $skill)->with('skill_count', $skill_count)->with('quote', $quote)->with('quote_count', $quote_count)->with('skill_slider', $skill_slider)->with('skill_slider_count', $skill_slider_count)->with('portfolio_piece', $portfolio_piece)->with('portfolio_piece_count', $portfolio_piece_count);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // Perfil de trabajador asociado al primer usuario
     WorkerProfile::create(['user_id' => 1]);
     // Registramos 3 valores de ejemplo
     Skill::create(['worker_profile_id' => 1, 'type' => 'Valor', 'name' => 'Empatía', 'description' => 'Saber escuchar y ser comprensivo. Saber ponerse en el lugar de los demás. Tratar de buscar soluciones a los problemas que se les presentan a los compañeros de trabajo en las labores diarias.']);
     Skill::create(['worker_profile_id' => 1, 'type' => 'Valor', 'name' => 'Equilibrio emocional', 'description' => 'Ante la eventualidad debe existir en si la tranquilidad y el actuar en forma normal. Todo individuo debe poseer este rasgo pues los desafíos impuestos por los cambios, son demasiado duros.']);
     Skill::create(['worker_profile_id' => 1, 'type' => 'Valor', 'name' => 'Etica', 'description' => 'Ser correctos y actuar en el marco de los principios individuales y sociales, que yacen en el ambiente interno y externo a la organización.']);
     // Registramos 3 habilidades de ejemplo
     Skill::create(['worker_profile_id' => 1, 'type' => 'Habilidad', 'name' => 'Capacidad de análisis', 'description' => 'Dentro del ámbito de las tareas que debe desempeñar, al momento de utilizar o desechar la información requerida para el cumplimiento de ellas, sobre todo cuando se trabaja sin supervisión directa.']);
     Skill::create(['worker_profile_id' => 1, 'type' => 'Habilidad', 'name' => 'Apertura', 'description' => 'Saber trabajar en interrelación con los demás profesionales de la empresa. Capacidad para trabajar en equipo, en torno a un grupo de proyectos o círculos de calidad. Apertura también se refiere a vivir las realidades existentes más allá del propio ser.']);
     Skill::create(['worker_profile_id' => 1, 'type' => 'Habilidad', 'name' => 'Buen comunicador', 'description' => 'Disponer de una cierta aptitud para la comunicación activa, y poseer la capacidad y la disposición para establecer una comunicación fluida y permanente.']);
     // Registramos 3 conocimientos de ejemplo
     Skill::create(['worker_profile_id' => 1, 'type' => 'Conocimiento', 'name' => 'Evaluar riesgos', 'description' => 'Por que para tomar decisiones y actuar en forma rápida y correcta, como la empresa moderna lo requiere, se debe evaluar en forma clara y precisa las acciones a seguir.']);
     Skill::create(['worker_profile_id' => 1, 'type' => 'Conocimiento', 'name' => 'Polifuncionalidad', 'description' => 'Este es uno de los rasgos que el trabajador moderno debe poseer con mayor intensidad. El trabajador actual debe estar capacitado para laborar en cualquier segmento de la empresa, y saber llevar a cabo las tareas que se le exijan o se le presenten en algún momento determinado.']);
     Skill::create(['worker_profile_id' => 1, 'type' => 'Conocimiento', 'name' => 'Conocer a la empresa', 'description' => 'En la forma interna el trabajador moderno debe conocer las estrategias empresariales, la misión y visión de la empresa, la estructura en sí. En forma externa, debe saber lo que el cliente necesita y busca.']);
 }
 /**
  * Splits categories into two equal parts
  *
  * @return array
  */
 static function splitInHalf()
 {
     $categoryWeight = 4;
     $all = self::visible()->get();
     $totalVisibleSkills = Skill::visible()->count() + count($all) * $categoryWeight;
     $splitted = [[], []];
     $currentSkillsCount = 0;
     $currentArray =& $splitted[0];
     foreach ($all as $category) {
         $skills = $category->visibleSkills()->count() + $categoryWeight;
         array_push($currentArray, $category);
         $currentSkillsCount += $skills;
         if ($currentSkillsCount > $totalVisibleSkills / 2 && empty($splitted[1])) {
             $currentArray =& $splitted[1];
         }
     }
     return $splitted;
 }
 /**
  * Display a list profile
  * 
  * @param  [int] $id 
  * @return Response
  */
 public function index(\Illuminate\Http\Request $request)
 {
     $positions = Position::all();
     $employee = Auth::user()->employee()->get()->first();
     $educations = Education::where('employee_id', '=', $employee->id)->get();
     $employee->date_of_birth = $this->convert_datetimesql_to_datepicker($employee->date_of_birth);
     $nationalities = Nationality::all();
     $skill = array("-1" => "None") + Skill::lists('skill', 'id');
     $employee_skills = EmployeeSkill::where('employee_id', '=', $employee->id)->get();
     $experiences = WorkingExperience::where('employee_id', '=', $employee->id)->get();
     foreach ($experiences as $key => $value) {
         $experiences[$key]->year_start = $this->convert_datetimesql_to_datepicker($value->year_start);
         $experiences[$key]->year_end = $this->convert_datetimesql_to_datepicker($value->year_end);
     }
     $flagMessage = $request->session()->get('flagMessage', 'false');
     $taken_projects = TakenProject::where('employee_id', '=', $employee->id)->get();
     return View('profiles.profiles', compact('positions', 'employee', 'experiences', 'nationalities', 'educations', 'employee_skills', 'skill', 'taken_projects', 'flagMessage'));
 }
 /**
  * Receive get request from editmore.blade.php
  * @param  [int] $id
  * @return [Illuminate\Contracts\View]
  */
 public function editmore($id, \Illuminate\Http\Request $request)
 {
     $positions = Position::all();
     $employee = Employee::find($id);
     $educations = Education::where('employee_id', '=', $employee->id)->get();
     $employee->date_of_birth = $this->convert_datetimesql_to_datepicker($employee->date_of_birth);
     $nationalities = Nationality::all();
     /*VIEW INFORMATION WORKING EXPERIENCE - VU*/
     $skill = array("-1" => "None") + Skill::lists('skill', 'id');
     $employee_skills = EmployeeSkill::where('employee_id', '=', $employee->id)->get();
     //dd(json_encode($employee_skills));
     $experiences = WorkingExperience::where('employee_id', '=', $employee->id)->get();
     foreach ($experiences as $key => $value) {
         $experiences[$key]->year_start = $this->convert_datetimesql_to_datepicker($value->year_start);
         $experiences[$key]->year_end = $this->convert_datetimesql_to_datepicker($value->year_end);
     }
     /*VIEW INFORMATION TAKEN PROJECT - VU*/
     $taken_projects = TakenProject::where('employee_id', '=', $employee->id)->get();
     $flagMessage = $request->session()->get('flagMessage', 'false');
     return View('employee.editmore', compact('positions', 'employee', 'experiences', 'nationalities', 'educations', 'employee_skills', 'skill', 'taken_projects', 'flagMessage'));
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     for ($i = 1; $i < 200; $i++) {
         $name = $faker->shuffle($faker->word());
         $recodeID = $faker->boolean(50) ? rand(0, $i) : NULL;
         Character::create(['name' => $name, 'savename' => $name, 'class' => $faker->randomElement($array = array('A', 'B', 'C', 'D', 'S', 'SS', 'Z')), 'race' => $faker->boolean(50), 'pot' => $faker->boolean(50), 'pof' => $faker->boolean(50), 'adventurer' => $faker->boolean(50), 'recode_id' => NULL]);
         for ($t = 1; $t < 4; $t++) {
             Job::create(['name' => $faker->shuffle($faker->name()), 'number' => $t, 'element' => $faker->randomElement($array = array('None', 'Fire', 'Ice', 'Darkness', 'Lightning', 'Heal', 'Remedy')), 'weapon' => $faker->randomElement($array = array('Sword', 'Bow', 'Spear', 'Staff')), 'minHP' => $faker->numberBetween(0, 130), 'maxHP' => $faker->numberBetween(200, 900), 'minATK' => $faker->numberBetween(0, 130), 'maxATK' => $faker->numberBetween(200, 900), 'minDEF' => $faker->numberBetween(0, 130), 'maxDEF' => $faker->numberBetween(200, 900), 'minMATK' => $faker->numberBetween(0, 130), 'maxMATK' => $faker->numberBetween(200, 900), 'minMDEF' => $faker->numberBetween(0, 130), 'maxMDEF' => $faker->numberBetween(200, 900), 'character_id' => $i]);
             for ($s = 1; $s < 5; $s++) {
                 $skillcount = Skill::all()->count();
                 $skill = Skill::where('id', rand(0, $skillcount - 1))->first();
                 JobSkill::create(['lvl' => rand(0, 15 * $s), 'skill_name' => $skill->name, 'affection' => $faker->word(), 'frequency' => rand(0, 101), 'job_id' => $t * $i]);
                 $itemcount = Item::all()->count();
                 $item = Item::where('id', rand(0, $itemcount - 1))->first();
                 JobItem::create(['quantity' => rand(0, 51), 'item_name' => $item->name, 'job_id' => $t * $i]);
             }
         }
         for ($j = 0; $j < rand(1, 5); $j++) {
             Iteration::create(['trigger' => $faker->word(), 'content' => $faker->text(), 'character_id' => $i, 'trigger_id' => NULL]);
         }
     }
 }
 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('profile.partials.cover', function ($view) {
         $view->with(['user' => Auth::user()]);
     });
     $this->composeEducation(new EducationRepository());
     $this->composeBiography();
     $this->composeMyArticles();
     $this->composeSkill();
     $this->composeLatestPosts();
     $this->composeProfileProgress();
     view()->composer('shop.partials.headerMenu', function ($view) {
         $shop = $view->getData()['shop'];
         $advantages = $shop->advantages()->lists('advantage_id')->toArray();
         $advantages_list = Advantage::get();
         $categories = $shop->products()->with('category')->groupBy('category_id')->get()->pluck('category.name', 'category.id');
         $view->with(['advantages_list' => $advantages_list, 'advantages' => $advantages, 'categories' => $categories]);
     });
     view()->composer('partials.navbar', function ($view) {
         if (Auth::check()) {
             if (session()->has('compare')) {
                 $compare = session()->get('compare');
                 $skills = Skill::whereIn('id', $compare['cases'])->get();
                 $view->with(['compares' => $skills]);
             }
             $view->with(['authUser' => Auth::user()]);
         }
     });
     /**
      * Created By Dara on 7/11/2015
      * settlement side view compose
      */
     view()->composer('partials.settleManagement', function ($view) {
         $view->with('amount', Auth::user()->credits()->sum('amount'));
     });
     view()->composer('partials.settleManagement', 'App\\Http\\Controllers\\EventController');
 }
Exemple #30
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     $card = Card::find($id);
     if (!$card) {
         // 无对应卡片数据
     }
     $skill = null;
     if ($card->skill_id != 0) {
         $skill = Skill::where("skill_id", $card->skill_id)->first();
     }
     $lskill = null;
     if ($card->lskill_id != 0) {
         $lskill = Lskill::where("lskill_id", $card->lskill_id)->first();
     }
     $objEvoTargetCard = null;
     $objMaterial1Card = null;
     $objMaterial2Card = null;
     $objMaterial3Card = null;
     $objMaterial4Card = null;
     if ($card->evo_id != 0) {
         $objEvoTargetCard = Card::where("card_id", $card->evo_id)->first();
         if ($card->material_id1 > 0) {
             $objMaterial1Card = Card::where("card_id", $card->material_id1)->first();
         }
         if ($card->material_id2 > 0) {
             $objMaterial2Card = Card::where("card_id", $card->material_id2)->first();
         }
         if ($card->material_id3 > 0) {
             $objMaterial3Card = Card::where("card_id", $card->material_id3)->first();
         }
         if ($card->material_id4 > 0) {
             $objMaterial4Card = Card::where("card_id", $card->material_id4)->first();
         }
     }
     return view('card.show')->withCard($card)->withSkill($skill)->withLskill($lskill)->withTitle($card->name_jp)->withAbilities(Ability::all())->withType1s(Type1::all())->withType2s(Type2::all())->withEvoTargetCard($objEvoTargetCard)->withMaterial1Card($objMaterial1Card)->withMaterial2Card($objMaterial2Card)->withMaterial3Card($objMaterial3Card)->withMaterial4Card($objMaterial4Card)->withAttrs(Attr::all());
 }