public function index() { $user_id = $this->user->id; $ownership = Projects::where('project_owner', $user_id)->where('status', '1')->get()->toArray(); $membership = DB::select("SELECT * FROM projects WHERE find_in_set({$user_id}, project_members) <> 0 AND status = 1"); return view('dashboard.index', compact('ownership', 'membership')); }
public function project(Request $request) { sleep(10); $project = Projects::where('projectsId', '=', $request->projectsId)->first(); array_add($project, 'slug', Handler::createSlug($project->title, '-')); if (count($project->movie) > 0) { foreach ($project->movie as $movie) { array_add($movie, 'embed', ProjectsMovie::embedVideo($movie->url)); } } $project->tags = str_replace(',', ', ', $project->tags); return view('website.project')->with(compact('project')); }
public function getMovieOrder($projectsId) { if (!ACL::hasPermission('projects', 'edit')) { return redirect(route('projects'))->withErrors(['You don\'t have permission for edit the movie of project.']); } $project = Projects::where('projectsId', '=', $projectsId)->first(); $movies = ProjectsMovie::where('projectsId', '=', $projectsId)->orderBy('sortorder', 'ASC')->get(); foreach ($movies as $movie) { array_add($movie, "image", ProjectsMovie::imageVideo($movie->url)); array_set($movie, "url", ProjectsMovie::embedVideo($movie->url, 1)); } return view('admin.projects.orderMovie')->with(compact('project', 'movies')); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { Projects::where('id', $id)->delete(); return back()->withSuccess('Project deleted successfully!'); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function public_modules($id) { $projectName = Projects::where('id', '=', $id)->pluck('title'); $moduleDara = Modules::whereproject_id($id)->get(); return view('public_journal.public_modules', compact('projectName', 'moduleDara')); }