コード例 #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     for ($i = 0; $i < 900; $i++) {
         $usuario = new Correo();
         $faker = Faker\Factory::create();
         $usuario->correo = $faker->email;
         $estado = rand(1, 4);
         if ($estado == 4) {
             $usuario->estatus = 'INACTIVO';
         } else {
             $usuario->estatus = 'ACTIVO';
         }
         $usuario->cliente_id = $faker->numberBetween($min = 1, $max = 25);
         $usuario->save();
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     $samples_temp = [];
     for ($i = 0; $i < 100; $i++) {
         $samples_temp[] = ['nombre' => $faker->name, 'email' => $faker->email];
     }
     Correo::insert($samples_temp);
 }
コード例 #3
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $correo = Correo::find($id);
     $cliente = Cliente::find($correo->cliente_id);
     $correo->delete();
     Flash::error('El correo ' . $correo->correo . ' fue eliminado correctamente');
     return redirect()->route('Admin.Sender.listarcorreos', $correo->cliente_id);
 }
コード例 #4
0
ファイル: MailController.php プロジェクト: soygalla/Plazas
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     Correo::enviaMail($request);
     return Redirect::to('/mensaje');
 }
コード例 #5
0
 public function destroy($id)
 {
     $Correo = Correo::find($id);
     $Correo->estado = "Inactivo";
     return JsonResponse::create(array('message' => "Eliminado Correctamente"), 200);
 }