public function listarClientes()
 {
     try {
         return Cliente::all();
     } catch (\Exception $ex) {
         Log::error($ex);
     }
     return null;
 }
 function getAllClientes(Request $request, Response $response)
 {
     $response = $response->withHeader('Content-type', 'application/json');
     $data = Cliente::all();
     if (count($data) == 0) {
         $response = $response->withStatus(404);
     }
     $response->getBody()->write($data);
     return $response;
 }
 public function destroy($id)
 {
     $cliente = Cliente::find($id);
     if (is_null($cliente)) {
         App::abort(404);
     }
     $cliente->delete();
     $clients = Cliente::all();
     return View::make('lista_clientes')->with('clients', $clients);
 }
 public function run()
 {
     $faker = Faker::create('pt_BR');
     $clientes = Cliente::all();
     $clientes_id = array();
     foreach ($clientes as $cliente) {
         $clientes_id[] = $cliente['id'];
     }
     $conversas = Conversa::all();
     $conversas_id = array();
     foreach ($conversas as $conversa) {
         $conversas_id[] = $conversa['id'];
     }
     foreach (User::all() as $user) {
         foreach (range(1, 10) as $index) {
             Tarefa::create(['icon' => 'fa-star', 'title' => 'Tarefa #' . $index . ' de ' . $user->username, 'description' => 'Descrição da tarefa #' . $index, 'date' => '2015-06-21', 'time' => '08:' . number_format($index, '2'), 'cliente_id' => NULL, 'conversa_id' => NULL, 'notification_id' => NULL, 'category_id' => '', 'owner_id' => $user->id, 'done' => false]);
         }
     }
 }
 public function run()
 {
     $faker = Faker::create('pt_BR');
     $clientes = Cliente::all();
     foreach ($clientes as $cliente) {
         $clientes_id[] = $cliente['id'];
     }
     $tarefas = Tarefa::all();
     foreach ($tarefas as $tarefa) {
         $tarefas_id[] = $tarefa['id'];
     }
     $relatorios = Relatorio::all();
     foreach ($relatorios as $relatorio) {
         $relatorios_id[] = $relatorio['id'];
     }
     foreach (range(1, 230) as $index) {
         $random_cliente_id = array_rand($clientes_id, 1);
         $random_tarefa_id = array_rand($tarefas_id, 1);
         Conversa::create(['data' => $faker->dateTime(), 'resumo' => $faker->text(50), 'cliente_id' => $random_cliente_id, 'tarefa_id' => $random_tarefa_id, 'relatorio_id' => '']);
     }
 }
 /**
  * Seleciona o destinatário para enviar o pedido via e-mail    
  *
  * @param  string  $email
  * @return Response
  */
 public function sendTo($id)
 {
     $pedido = $id;
     $fornecedores = Fornecedor::all();
     $vendedores = Vendedor::all();
     $clientes = Cliente::all();
     return View::make('pedidos.enviar', compact('pedido', 'fornecedores', 'vendedores', 'clientes'));
 }
Exemple #7
0
/*
|--------------------------------------------------------------------------
| HOME
|--------------------------------------------------------------------------
*/
Route::get('/', function () {
    return Redirect::to('agenda');
});
Route::when('/', 'auth');
/*
|--------------------------------------------------------------------------
| DEMO
|--------------------------------------------------------------------------
*/
Route::get('/demo', function () {
    $clientes = Cliente::all();
    $tarefas = Tarefa::all();
    return View::make('demo', compact('clientes', 'tarefas'));
});
/*
|--------------------------------------------------------------------------
| AGENDA
|--------------------------------------------------------------------------
*/
Route::get('agenda/print', array('as' => "agenda.print", 'uses' => 'AgendaController@index'));
Route::resource('agenda', 'AgendaEventsController');
Route::get('agenda/{id}/delete', array('uses' => 'AgendaEventsController@destroy'));
Route::get('agenda/', array('uses' => 'AgendaController@index'));
Route::when('agenda*', 'auth');
/*
|--------------------------------------------------------------------------
 public function get_index()
 {
     $clientes = Cliente::all();
     return View::make('clientes.index')->with('clientes', $clientes);
 }
Exemple #9
0
 public function index($registros = 20)
 {
     //$cod="1";
     //$datos = Cliente::paginate($registros);
     $clientes = Cliente::all();
     //$clientes = Cliente::where('codCarrera','=',$cod)->get();
     $datos = DB::table('tcliente')->select('tcliente.idcliente', 'tcliente.capellido', 'tcliente.cnombre', 'tcliente.cpasaporte', 'tcliente.cnacionalidad', 'tcliente.cedad')->get();
     return View::make('cliente.index', compact("datos"), array('clientes' => $clientes));
 }
 /**
  * Adiciona um item randomico
  *
  * @return Response
  */
 public function add()
 {
     // // redirect
     // Session::flash('message', 'Um cliente randomico foi adicionado!');
     // return Redirect::to('clientes');
     // get all the clientes
     $clientes = Cliente::all();
     // load the view and pass the clientes
     return View::make('clientes.index')->with('clientes', $clientes);
 }