/** * Display a listing of the resource. * * @return Response */ public function index() { $todos = Todo::all(); $count = DB::table('todos')->where('done', '=', 0)->count(); // return $todos; return response()->json(['todo' => $todos->toArray(), 'count' => $count], 200); }
/** * Execute the console command. * * @return mixed */ public function handle() { $todos = Todo::all(); foreach ($todos as $todo) { $this->info($todo->title); } }
/** * Display a listing of the resource. * * @return Response */ public function index() { // get all the nerds $todos = Todo::all(); // load the view and pass the nerds return view('todos.index')->with('todos', $todos); }
public function get_labels_settings() { if (!Auth::user()) { //echo 'ingelogd'; return Redirect::route('user_login'); } $view = view::make("settings.labels"); $view->projects = Project::all(); $view->tasks = Todo::all(); return $view; }
/** * Display a listing of the resource. * * @return Response */ public function index() { //return view('app'); // resources/views/app.blade.php 불러옴 $todos = Todo::all(); /*메일 보내는 방법 $data['message'] = '김수로님'; Mail::send('emails.welcome', $data, function($message) { $message->to('*****@*****.**', 'John Smith')->subject('[분쟁제로] 사이트 이용방법'); });*/ return view('boon.post.list', compact('todos')); // = 같음 // return view('boon.post.list', ['todos' => $todos]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { //return view('todo.index', ['todos' => Todo::all()]); $redis = Redis::connection(); $key = 'todo_all'; $todos = $redis->get($key); if (is_null($todos)) { $todos = Todo::all(); $redis->set($key, serialize($todos)); } else { $todos = unserialize($todos); } return view('todo.index', ['todos' => $todos]); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $books = Todo::all(); return $this->fractal->collection($books, new BookTransformer()); }
/** * Display a listing of the resource. * * @return Response */ public function index() { // $todos = Todo::all(); return $todos; }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $todos = Todo::all(); return view('home')->with('todos', $todos); }
/** * Display a listing of all Todos. * * @return Response */ public function all() { $todos = Todo::all(); return view('todos.all', compact('todos')); }
<?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ use App\Todo; Route::get('/api/todos', function () { $todos = Todo::all()->toArray(); return response()->json($todos); }); Route::resource('todo', 'TodoController');
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $data = Todo::all(); return response()->json($data); }
public function getIndex() { $todos = Todo::all(); return view('welcome', compact('todos')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function getIndex() { $todos = Todo::all(); $data = array('todos' => $todos); return view('todo.index', $data); }
Route::resource('users', 'UsersController'); }); //spa gallery Route::get('galeri-spa', function () { return view('gallery.index'); // return 'foo'; }); Route::resource('galeri', 'GalleryController'); Route::post('login', 'UsersController@checkAuth'); //todo app Route::get('todos', function () { return view('todo.index'); }); use App\Todo; Route::get('api/todos', function () { return Todo::all(); }); Route::post('api/todos', function () { return Todo::create(Input::all()); }); // Route::delete('api/todos/{id}',function($id){ // $data = Todo::findOrFail($id); // return Todo::delete($data); // }); /* vuejs */ Route::get('vuejs', function () { return view('vue.index'); }); Route::get('api/notes', function () {
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $todos = Todo::all(); return response()->json($todos); }
public function index() { $data = Todo::all(); return view('home')->with('data', $data); }
/** * get all todos * @return Collection */ public function index() { $todos = Todo::all(); return view('todos.index')->with(compact('todos')); }
public function getNew() { $todo = Todo::all(); return View::make('todo.new', ['todos' => $todo]); }
/** * get all todos * @return Collection */ public function index() { return Todo::all(); }