/** * Show the manage page for projects * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function projects() { $title = "工程管理"; $manage = true; $projects = Project::latest()->paginate(50); return view('manage.projects', compact('title', 'manage', 'projects')); }
public function index() { $projects = Project::latest()->where('published', 1)->get(); $illustrations = Illustration::latest()->get(); $logos = Logo::latest()->get(); return view('front', compact('projects', 'illustrations', 'logos')); }
public function index() { $projects = Project::latest('date_created')->get(); $selected_projects = Project::latest('date_created')->where('important', 1)->get(); //dd($selected_projects); return view('projects.index', compact('projects', 'selected_projects')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function viewProjectsList() { $projects = Project::latest()->get(); $published = $projects->where('published', 1)->count(); $unpublished = $projects->where('published', 0)->count(); $projectRoles = ProjectRole::lists('name', 'id'); return view('dashboard.project.projects', compact('projects', 'published', 'unpublished', 'projectRoles')); }
public function store(ProjectRequest $request) { Project::create($request->all()); //AFTER the row is added, get the last record to pass to the next page. $project = Project::latest()->first(); $update = \Session::flash('flash_message', 'Client ' . $project->project_name . ' for ' . $project->last_name . ' was created.'); return redirect('projects'); }
private function composeSidebar() { view()->composer('home.partials.projects', function ($view) { $projects = \App\Project::latest()->get(); $num = count($projects); $view->with(compact('projects', 'num')); }); }
public function addProject() { //inserting using user relationship $newProject = Request::all(); Auth::user()->projects()->create($newProject); $projects = Project::latest('created_at')->userProjects()->get(); return redirect('projects'); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $num_per_page = env('num_per_page_admin'); $projects = Project::latest()->paginate($num_per_page); return view('admin.projects.index', compact('projects')); }
/** * Return a view to display the list of projects * * @return Response */ public function index() { $projects = Project::latest()->get(); return view('projects.index')->with('projects', $projects); }
public function index() { $projects = Project::latest()->limit(7)->get(); return view('pages.index', compact('projects')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $blog = \App\Blog::latest()->first(); $project = \App\Project::latest('date_created')->first(); return view('welcome')->with(compact('blog', 'project')); }