Ejemplo n.º 1
0
 public function page_project($id)
 {
     $data['project'] = Project::find($id);
     $data['meta_title'] = $data['project']->meta_title;
     $data['meta_desc'] = $data['project']->meta_desc;
     return view('page_project', $data);
 }
Ejemplo n.º 2
0
    public function ajaxRequest($id = 1, $modal_name = null)
    {
        // dd($modal_name);
        if ($modal_name == 'modal-service') {
            // get all the service_details
            $service_detail = Service_detail::find($id);
            $service_detail->image = "<img class=\"radius2px img-responsive\" src=\"public/{$service_detail->image}\">";
            return $service_detail;
        } else {
            // get all the Projects
            $project = Project::orderBy('position')->select('detail_title', 'text')->find($id);
            // get all the Project_image
            $project_images = Project_image::where('project_id', '=', $id)->orderBy('position')->get(['image']);
            $images = '';
            $pagers = '';
            foreach ($project_images as $key => $project_images_item) {
                $images .= <<<IMG
<li><img src="public/{$project_images_item->image}"/></li>
IMG;
                $pagers .= <<<PG
<a data-slide-index="{$key}" href=""><img src="public/{$project_images_item->image}"/></a>
PG;
            }
            // $pagers .= '</div>';
            return compact('project', 'images', 'pagers');
            // return ['detail_title' => 'title', 'text' => '{{$test}}', 'image' => '<img class="radius2px img-responsive" src="http://www.concept7.com.tr/uploades/service_detail/34158-image().jpg">'];
        }
    }
Ejemplo n.º 3
0
 public function destroy($id)
 {
     if (Auth::user()->can_delete(3)) {
         if ($project = Project::find($id)) {
             $dir = public_path('images/project/' . $project->id);
             if (File::isDirectory($dir)) {
                 File::deleteDirectory($dir);
             }
             $project->delete();
             return redirect()->route('admin.project.index')->with(['type' => 'danger', 'message' => '<span class="fa fa-times"></span> Le projet a bien été supprimé.']);
         } else {
             return redirect()->route('admin.project.index')->with(['type' => 'danger', 'message' => '<span class="fa fa-times"></span> Le projet sélectionné n\'existe pas.']);
         }
     } else {
         return redirect()->route('admin.dashboard.index')->with(['type' => 'danger', 'message' => '<span class="fa fa-ban"></span> Vous n\'avez pas les droits nécessaires pour accéder à cette partie.']);
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $project_image = Project_image::find($id);
     // get the project
     $project = Project::find($project_image->project_id);
     // delete
     $project_image->delete();
     // redirect
     \Session::flash('message', 'Successfully deleted the project_image!');
     return \Redirect::to("admin/project_images/{$project->id}");
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $records = Project::all();
     return view('projects.index', compact('records'));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     // delete
     $project = Project::find($id);
     $project->delete();
     // redirect
     \Session::flash('message', 'Successfully deleted the project!');
     return \Redirect::to('admin/projects');
 }