Exemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(PersonatRequest $person, InfoRequest $info, KontaktRequest $kontakt)
 {
     $vendlindja = Qytet::firstOrCreate(['qyteti' => $person->get('vendlindja')]);
     $profesioni = Profesioni::firstOrCreate(['profesioni' => $person->get('profesioni')]);
     $gjendja_civile = GjendjaCivile::firstOrCreate(['statusi' => $person->get('gjendja_civile')]);
     Personat::create(['emer' => $person->get('emer'), 'mbiemer' => $person->get('mbiemer'), 'datelindja' => $person->get('datelindja'), 'vendlindja' => $vendlindja->id, 'profesioni' => $profesioni->id, 'gjinia' => $person->get('gjinia'), 'gjendja_civile' => $gjendja_civile->id]);
     $personi = Personat::where('emer', $person->get('emer'))->where('mbiemer', $person->get('mbiemer'))->where('datelindja', $person->get('datelindja'))->first();
     Pozicioni::firstOrCreate(['pozicioni' => $info->get('pozicioni')]);
     $pozicioni = Pozicioni::where(['pozicioni' => $info->get('pozicioni')])->first();
     Gatishmeria::firstOrCreate(['gatishmeria' => $info->get('gatishmeria')]);
     $gatishmeria = Gatishmeria::where(['gatishmeria' => $info->get('gatishmeria')])->first();
     $qendra = Dega::where(['dega' => $info->get('qendra')])->first();
     $programi = Programi::where(['programi' => $info->get('programi')])->first();
     Info::create(['personi' => $personi->id, 'qendra' => $qendra->id, 'pozicioni' => $pozicioni->id, 'programi' => $programi->id, 'disponimi' => $info->get('disponimi'), 'gatishmeria' => $gatishmeria->id, 'koha' => $info->get('koha'), 'rregjistrimi' => $info->get('rregjistrimi'), 'viti_i_fundit' => $info->get('viti_i_fundit')]);
     Kontakt::create(['personi' => $personi->id, 'email' => $kontakt->get('email'), 'telefon' => $kontakt->get('telefon'), 'celular' => $kontakt->get('celular')]);
     //		foreach(Input::get('njohuri_te_tjera[]') as $key => $njohuri){
     NjohuriShtese::firstOrCreate(['njohuri_shtese' => Input::get('njohuri_te_tjera')]);
     $njohuri = NjohuriShtese::where(['njohuri_shtese' => Input::get('njohuri_te_tjera')])->first();
     //		}
     $personi->njohuri_shtese()->attach($njohuri->id);
     return $personi;
 }
Exemplo n.º 2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('infos')->truncate();
     Info::create(['title' => 'DS dev', 'content' => "Réviser le modèle MVC", 'week' => '10']);
 }
 public function run()
 {
     //        DB::table('info')->delete();
     Info::create(array('info' => 'Esam muzicējoši jaunieši, kuri satikās folkloras kopā "Kokle". Visi dzīvojam Teikā, no kurienes arī mūsu nosaukums. Esam muzikāli instrumentāla apvienība, kuras dalībnieki katrs savā laikā pievienojās folkloras kopai Kokle. Gadu gaitā sapratām, ka esam labi sadziedājušies un saspēlējušies tāpēc nolēmām izveidot "Teikas Muzikantus".'));
 }
Exemplo n.º 4
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     Info::create($request->all());
     return redirect('/profile/' . $request->user()->id);
 }