コード例 #1
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">'];
        }
    }
コード例 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     // get all the projects
     $projects = Project::orderBy('position')->get();
     // load the view and pass the projects
     return \View::make('admin.pages.projects.index')->with('projects', $projects);
     //
 }