/**
  * Display a conversation and replies
  *
  * @param $slug
  * @return \Illuminate\View\View
  */
 public function show($slug)
 {
     $conversation = $this->conversationRepo->findBySlug($slug);
     $topic = Topic::all();
     $replies = $conversation->replies()->orderBy('created_at', 'DESC')->paginate(4);
     return view('Forum::Conversations.show', compact('conversation', 'replies', 'topic'));
 }
 public function getRandomTopic()
 {
     $newarray = [];
     for ($i = 0; $i < 10; $i++) {
         $me = Topic::all()->random(1)->toarray();
         array_push($newarray, $me);
     }
     return response()->json(['error' => false, 'topic' => $newarray]);
 }
 public function getNew()
 {
     $resource = new Resource();
     $allTopics = Topic::all()->sortBy('name');
     $topics = [];
     foreach ($allTopics as $topic) {
         $topics += [$topic->id => $topic->name];
     }
     return view('resources.new', ['topics' => $topics, 'resource' => $resource]);
 }
Exemplo n.º 4
0
 public function index()
 {
     $topic = new Topic();
     $topics = Topic::all();
     //echo "<pre>";
     //$ss = $topic->GetUserinfo();
     //print_r($ss);
     //echo $topic::find(1)->user->username;
     $product = \Product::Find(['slug' => 'decorative-hedgehogs']);
     print_r($product);
     return view("index")->with('topic', $topics);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $resource = Resource::find($id);
     // return var_dump($resource);
     $allTopics = Topic::all()->sortBy('name');
     $topics = [];
     foreach ($allTopics as $topic) {
         $topics += [$topic->id => $topic->name];
         if ($resource->topics->has($topic->id)) {
         }
     }
     // return view('resources.edit')->with('resource', $resource);
     return view('admin.resources.edit')->with('resource', $resource)->with('topics', $topics);
 }
 public function getPage()
 {
     // $route = $request->route();
     // $name = $route->getName();
     $page = \Request::route()->getName();
     $topics = Topic::all();
     $resources = Resource::all();
     $data = ["topics" => $topics, "resources" => $resources];
     // return $data["topics"];
     if ($page) {
         return view("admin.{$page}", $data);
     } else {
         return redirect('/admin', $data);
     }
 }
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     //
     $latest = Resource::where('approved', '=', true)->orderBy('created_at', 'desc')->take(42)->get();
     $topics = Topic::all()->sortBy('name');
     $wide = false;
     $featured_resources = Resource::getFeatured(5);
     $sidebar_ads['adsense'] = "<script type='text/javascript'>google_ad_client = 'ca-pub-4190828597999315'\\; google_ad_slot = '8479557582'; google_ad_width = 336; google_ad_height = 280;</script><!-- startupwrench-sidebar-top --><script type='text/javascript' src='//pagead2.googlesyndication.com/pagead/show_ads.js'></script>";
     $sidebar_ads['inmotion'] = "<a href='" . url('/go/inmotion') . "'><img src='" . url('/uploads/ih_wordpress-336x280.gif') . "' class='img-responsive'></a>";
     // $side_ads_safe = [$inmotion];
     // $side_ads_all = [$adsense, $inmotion];
     view()->share('latest', $latest);
     view()->share('topics', $topics);
     view()->share('sidebar_ads', $sidebar_ads);
     view()->share('featured_resources', $featured_resources);
 }
Exemplo n.º 8
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $topics = Topic::all();
     return view('topic.index', compact('topics'));
 }
Exemplo n.º 9
0
 public function train()
 {
     $topics = Topic::all();
     return view('quiz.train', compact('topics'));
 }
Exemplo n.º 10
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $topics = Topic::all()->sortByDesc('updated_at');
     return view('topics.index', compact('topics'));
 }
Exemplo n.º 11
0
 public function home()
 {
     $topics = Topic::all();
     return view('pages.home', compact('topics'));
 }
 public function create()
 {
     $questions = Question::all()->groupBy('topic_id');
     $topics = Topic::all()->pluck('text', 'id')->all();
     return view('questionaire.create', compact('questions', 'topics'));
 }
 public function index()
 {
     //Topicsテーブルのデータをすべて取得する
     $topics = Topic::all();
     return view('topics.index', compact('topics'));
 }
 /**
  * @param Request $request
  *
  * @return \Illuminate\View\View
  */
 public function search(Request $request)
 {
     $conversations = $this->conversationRepo->search($request->all());
     $topic = Topic::all();
     return view('Forum::index', compact('conversations', 'topic'));
 }