/** * Run the database seeds. * * @return void */ public function run() { Contacts::create(['name' => 'Icam', 'rfc' => 'XAXX010101000', 'address' => 'pendiente', 'phone_1' => '7771234567', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Salvador Arturo Rodriguez Loera', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'PROVEEDOR']); Contacts::create(['name' => 'Hospital Angeles', 'rfc' => 'XAXX010101000', 'address' => 'Calle Agrarismo No. 208, Escandón, Miguel Hidalgo, 11800 Ciudad de México, D.F., México', 'phone_1' => '01 (55) 5516 9900', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Gela Yever Garces', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'CLIENTE']); Contacts::create(['name' => 'Hospital Reforma', 'rfc' => 'XAXX010101000', 'address' => 'Calle Agrarismo No. 208, Escandón, Miguel Hidalgo, 11800 Ciudad de México, D.F., México', 'phone_1' => '01 (55) 5516 9900', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Gela Yever Garces', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'CLIENTE']); Contacts::create(['name' => 'Hospital Siglo XXI', 'rfc' => 'XAXX010101000', 'address' => 'Calle Agrarismo No. 208, Escandón, Miguel Hidalgo, 11800 Ciudad de México, D.F., México', 'phone_1' => '01 (55) 5516 9900', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Gela Yever Garces', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'CLIENTE']); Contacts::create(['name' => 'Dr. Eleazar garcía', 'rfc' => 'XAXX010101000', 'address' => 'Calle Agrarismo No. 208, Escandón, Miguel Hidalgo, 11800 Ciudad de México, D.F., México', 'phone_1' => '01 (55) 5516 9900', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Gela Yever Garces', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'CLIENTE']); Contacts::create(['name' => 'Médica Sur', 'rfc' => 'XAXX010101000', 'address' => 'Calle Agrarismo No. 208, Escandón, Miguel Hidalgo, 11800 Ciudad de México, D.F., México', 'phone_1' => '01 (55) 5516 9900', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Gela Yever Garces', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'CLIENTE']); }
public function store(Request $request) { // dd($request->all()); $this->validate($request, ['name' => 'required', 'username' => 'required', 'email' => 'required', 'address' => 'required', 'likes' => 'required', 'gender' => 'required']); $input = $request->all(); Contacts::create($input); Session::flash('flash_message', 'Task successfully added!'); return redirect()->back(); }
public function store() { $data = Request::all(); if (intval($data['id'])) { Contacts::where('id', intval($data['id']))->update($data); } else { Contacts::create($data); } return redirect(url('/')); }
/** * Store a newly created resource in storage. * * @return Response */ public function store() { $params = Request::get('_form'); $photo = ""; $name = $params['name']; $surname = $params['surname']; $address = $params['address']; $photo = $params['image']; $contact = Contacts::create(array('name' => $name, 'surname' => $surname, 'address' => $address, 'photo' => $photo)); //creo i numeri telefonici associati $numbers = $params['numbers']; foreach ($numbers as $number) { Numbers::create(array('number' => $number, 'contact_id' => $contact->id)); } return response()->json(array('id' => $contact->id, 'name' => $contact->name, 'surname' => $contact->surname, 'photo' => $contact->photo)); }
public function store(Request $request) { $v = $this->validator($request->all()); //VALIDACIÓN DE FORMULARIO if ($v->fails()) { return redirect()->back()->withErrors($v->errors())->withInput(); } else { //SE CREA UN NUEVO PORCENTAJE DE GANANCIA if (Contacts::create($request->all())) { //SE REGISTRA LA ACTIVIDAD EN LA BITACORA $this->binnacle("REGISTRÓ NUEVO CONTACTO", $request); } Session::flash('message', 'Contacto creado correctamente'); return Redirect::to('/contact/create'); } }
public function run() { //nomi e cognomi $nomi = ['Marco', 'Elena', 'Giorgio', 'Daphne', 'Margherita', 'Francesco']; $cognomi = ['Bevilacqua', 'Aquilano', 'Delli Carri', 'La notte', 'De Luca', 'Fatigato']; $indirizzo = ""; for ($i = 0; $i <= 10; $i++) { //shuffle degli array con nomi e cognomi shuffle($nomi); shuffle($cognomi); //index randomico $index_nomi = mt_rand(0, count($nomi) - 1); $index_cognomi = mt_rand(0, count($cognomi) - 1); //creazione del record \App\Contacts::create(array('name' => $nomi[$index_nomi], 'surname' => $cognomi[$index_cognomi], 'address' => $indirizzo, 'photo' => "")); } }
/** * Store a newly created resource in storage. * * @return Response */ public function store(Request $request) { //validation rules $this->validate($request, array('name' => 'required', 'surname' => 'required', 'address' => 'required')); $photo = ""; /* @var array $params */ $params = Input::get(); $name = $params['name']; $surname = $params['surname']; $address = $params['address']; if (array_key_exists('image', $params)) { $photo = $params['image']; } $contact = Contacts::create(array('name' => $name, 'surname' => $surname, 'address' => $address, 'photo' => $photo)); //associated phone numbers $numbers = $params['number']; foreach ($numbers as $number) { Numbers::create(array('number' => $number, 'contact_id' => $contact->id)); } return response()->json(array('contact' => $contact)); }
/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(Request $request) { //$this->validate($request, ['name' => 'required']); // Uncomment and modify if you need to validate any input. Contacts::create($request->all()); return redirect('contacts'); }
/** * Store a newly created contacts in storage. * * @param CreateContactsRequest|Request $request */ public function store(CreateContactsRequest $request) { $request = $this->saveFiles($request); Contacts::create($request->all()); return redirect()->route('admin.contacts.index'); }