コード例 #1
0
 public function run()
 {
     // DB::table('gender')->delete();
     DB::table('gender')->truncate();
     $male = Gender::create(array('gender' => 'Male'));
     $female = Gender::create(array('gender' => 'Female'));
 }
コード例 #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $genders = array(['gender_type' => 'male'], ['gender_type' => 'female']);
     foreach ($genders as $gender) {
         Gender::create($gender);
     }
 }
コード例 #3
0
 private function getGenders()
 {
     $genders_rs = Gender::orderBy('name', 'asc')->get();
     $genders = [0 => 'Choose a gender'];
     foreach ($genders_rs as $g) {
         $genders[$g->id] = $g->name;
     }
     return $genders;
 }
コード例 #4
0
ファイル: DirectorsController.php プロジェクト: kakapa/erpbox
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Director $director)
 {
     // Edit an exisiting director
     $brands = Brand::lists('short_name', 'id');
     $statuses = Status::lists('name', 'id');
     $genders = Gender::lists('name', 'id');
     $titles = Title::lists('name', 'id');
     return view('directors.edit', compact('director', 'brands', 'statuses', 'users', 'titles', 'genders'));
 }
コード例 #5
0
ファイル: SiteController.php プロジェクト: haseo2015/laravel
 public function getListByGender($slug)
 {
     $currentMC = collect();
     $currentMC->name = \App\Gender::getGenderBySlug($slug)[0]->gender;
     $currentMC->fonticon = "";
     $projects = \App\Project::getProjectsByGender($slug);
     //dump($currentMC);
     return view('cosplaydesign.pages.lista', compact("projects", "currentMC"));
 }
コード例 #6
0
ファイル: LeadsController.php プロジェクト: kakapa/erpbox
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Lead $lead)
 {
     // Edit an exisiting lead
     $stages = Stage::lists('name', 'id');
     $sources = Source::lists('name', 'id');
     $genders = Gender::lists('name', 'id');
     $titles = Title::lists('name', 'id');
     $users = User::lists('name', 'id');
     return view('leads.edit', compact('lead', 'stages', 'sources', 'users', 'titles', 'genders'));
 }
コード例 #7
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create('it_IT');
     $projectsID = $this->getProjectIdsArray();
     $genders = array('anime', 'manga', 'videogames', 'films', 'telefilms', 'serie tv', 'altro');
     foreach ($genders as $gender) {
         $slug = Str::slug($gender);
         $_gender = Gender::create(['gender' => $gender, 'slug' => $slug, 'active' => 1]);
         $_gender->projects()->sync($faker->randomElements($projectsID, mt_rand(1, 1)));
     }
 }
コード例 #8
0
 public function show($id)
 {
     $gender = Gender::find($id);
     //return $gender;
     if (count($gender) > 0) {
         $statusCode = 200;
         $response = ['id' => $gender->id, 'Gender' => $gender->gender];
     } else {
         $response = ["error" => "Gender doesn`t exist"];
         $statusCode = 404;
     }
     return response($response, $statusCode)->header('Content-Type', 'application/json');
 }
コード例 #9
0
ファイル: DatabaseSeeder.php プロジェクト: skafetzo/SPtool
 public function run()
 {
     DB::table('gender')->delete();
     Gender::create(['id' => '1', 'gender' => 'Male']);
     Gender::create(['id' => '2', 'gender' => 'Female']);
 }
コード例 #10
0
ファイル: Gender.php プロジェクト: haseo2015/laravel
 public static function getProjectsByGender($slug)
 {
     $gender = \App\Gender::getGenderBySlug($slug)[0]->id;
     return \App\Gender::find($gender)->projects;
 }
コード例 #11
0
ファイル: ProfileController.php プロジェクト: skafetzo/SPtool
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit()
 {
     //
     $gender = Gender::lists('gender', 'id');
     $age = Age::lists('age', 'id');
     $occupation = Occupation::lists('occupation', 'id');
     $country = Country::orderBy('country')->lists('country', 'id');
     //for alphabetic order
     $education = Education::lists('education', 'id');
     //return Auth::User()->profile;
     return view('user.edit', compact('gender', 'age', 'occupation', 'country', 'education'));
 }
コード例 #12
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $data['title'] = 'Edit Staff';
     $data['staff'] = Staff::find($id);
     $data['staff_menu'] = 1;
     $data['gender'] = Gender::lists('gender', 'id')->prepend('Please Select');
     $data['countries'] = Country::lists('name', 'id')->prepend('Please Select');
     $data['states'] = State::lists('name', 'id')->prepend('Please Select');
     $data['locals'] = Local::lists('local_name', 'id')->prepend('Please Select');
     $data['staff_types'] = StaffType::lists('staff_type', 'id')->prepend('Please Select');
     return view('admin.staff.edit', $data);
 }
コード例 #13
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $genders = Gender::lists('gender_name', 'id')->all();
     $category = Category::find($id);
     return view('admin.categories.edit', compact('category', 'genders'));
 }
コード例 #14
0
ファイル: routes.php プロジェクト: mreeves1/grandprix.run
 */
Route::get('records', 'RecordController@index');
Route::resource('record', 'RecordController');
/**
 * Display All Users
 */
Route::get('/users', function () {
    // Roles
    $roles_rs = Role::orderBy('name', 'asc')->get();
    $roles = [];
    $roles[0] = 'Choose a roles';
    foreach ($roles_rs as $r) {
        $roles[$r->id] = $r->name;
    }
    // Genders
    $genders_rs = Gender::orderBy('name', 'asc')->get();
    $genders = [];
    $genders[0] = 'Choose a gender';
    foreach ($genders_rs as $g) {
        $genders[$g->id] = $g->name;
    }
    // Clubs
    $clubs_rs = Club::orderBy('name', 'asc')->get();
    $clubs = [];
    $clubs[0] = 'Choose a club';
    foreach ($clubs_rs as $c) {
        $clubs[$c->id] = $c->name;
    }
    $users = User::orderBy('created_at', 'asc')->get();
    return view('users', ['title' => 'Users', 'clubs' => $clubs, 'genders' => $genders, 'roles' => $roles, 'users' => $users]);
});
コード例 #15
0
ファイル: Project.php プロジェクト: haseo2015/laravel
 public static function getProjectsByGender($gender)
 {
     $baseProjects = \App\Gender::getProjectsByGender($gender);
     $projectsComplete = collect();
     foreach ($baseProjects as $project) {
         $progetto = \App\Project::getFullProjectData($project->id);
         $projectsComplete->push($progetto);
     }
     return $projectsComplete;
 }
コード例 #16
0
ファイル: GendersController.php プロジェクト: kakapa/erpbox
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Gender $gender)
 {
     // Delete $gender
     $gender->delete();
     flash()->success('Gender has been deleted');
     return redirect('genders');
 }
コード例 #17
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $data['parent'] = StudentParent::find($id);
     $data['parents_menu'] = 1;
     $data['title'] = 'Edit Parent';
     $data['gender'] = Gender::lists('gender', 'id')->prepend('Please Select');
     $data['bloodGroups'] = BloodGroup::lists('blood_group', 'id')->prepend('Please Select');
     $data['locals'] = Local::lists('local_name', 'id')->prepend('Please Select');
     $data['states'] = State::lists('name', 'id')->prepend('Please Select');
     $data['countries'] = Country::lists('name', 'id')->prepend('Please Select');
     $data['religions'] = Religion::lists('religion', 'id')->prepend('Please Select');
     return view('admin.parents.edit', $data);
 }
コード例 #18
0
 public function index()
 {
     $gender = Gender::all()->toArray();
     return $gender;
 }
コード例 #19
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $data['student'] = Student::find($id);
     $data['title'] = 'Edit ' . $data['student']->fname;
     $data['students_menu'] = 1;
     $data['gender'] = Gender::lists('gender', 'id')->prepend('Please Select');
     $data['bloodGroups'] = BloodGroup::lists('blood_group', 'id')->prepend('Please Select');
     $data['locals'] = Local::lists('local_name', 'id')->prepend('Please Select');
     $data['states'] = State::lists('name', 'id')->prepend('Please Select');
     $data['countries'] = Country::lists('name', 'id')->prepend('Please Select');
     $data['parents'] = StudentParent::select(\DB::raw('concat (fname," ",lname) as full_name, id'))->lists('full_name', 'id')->prepend('Please Select');
     $data['classes'] = StudentClass::lists('name', 'id')->prepend('Please Select');
     $data['religions'] = Religion::lists('religion', 'id')->prepend('Please Select');
     return view('admin.students.edit', $data);
 }
コード例 #20
0
 public function getById($id)
 {
     $gender = Gender::with('translations')->find($id);
     return $gender;
 }