Exemplo n.º 1
0
 /**
  * Function for update a blog article.
  */
 public function create()
 {
     $pagecode = 'jeSu7UYVbVM6S0IF';
     $meta = Meta::where('code', $pagecode)->firstOrFail();
     $catergories = ArticleCategory::select('id', 'name')->get()->pluck('id', 'name')->flip();
     return view('core.article.create', compact('catergories', 'meta'));
 }
Exemplo n.º 2
0
 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     View::composer('partials.meta', function ($view) {
         $meta = null;
         if ($view->post) {
             $postId = $view->post->id;
             $meta = Meta::where('post_id', '=', $postId)->first();
         }
         if (!$meta) {
             $meta = json_decode(json_encode($this->defaultMeta), FALSE);
         }
         $view->with('meta', $meta);
     });
 }
Exemplo n.º 3
0
 Route::get('about', 'PagesController@about');
 Route::get('contact', 'PagesController@contact');
 Route::post('contact', 'PagesController@contactPost');
 Route::get('projects', 'PagesController@projects');
 Route::get('dashboard', 'PagesController@dashboard');
 Route::get('blog/category', function () {
     return redirect('blog');
 });
 Route::get('blog/category/{slug}', function ($slug) {
     $category = ArticleCategory::where('name', $slug)->first();
     if (is_null($category)) {
         return redirect('blog');
     }
     $articles = Article::where('category', $category->id)->published()->listing()->paginate(4);
     $pagecode = '8PWLY8FGtvp2nQ5D';
     $meta = Meta::where('code', $pagecode)->firstOrFail();
     return view('core.article.index', compact('articles', 'meta'));
 });
 /**
  * Blog or Article Requests.
  */
 Route::resource('blog', 'BlogController');
 /**
  * User Authentication, Registation & Profiles Requests.
  */
 Route::get('login', 'Auth\\AuthController@getLogin');
 Route::post('login', 'Auth\\AuthController@postLogin');
 Route::get('logout', 'Auth\\AuthController@getLogout');
 Route::get('register', 'Auth\\AuthController@getRegister');
 Route::post('register', 'Auth\\AuthController@postRegister');
 /**
Exemplo n.º 4
0
 public function metaValorAll()
 {
     $metas_diario = Meta::where("tipo", "valor_diaria")->get();
     $metas_mensal = Meta::where("tipo", "valor_mensal")->get();
     $metas = ['metas_diario' => $metas_diario, 'metas_mensal' => $metas_mensal];
     return response()->json($metas);
 }
Exemplo n.º 5
0
 public function dashboard()
 {
     /*	
     		$suggestions[1][0] = " ";
     
     		if(isset($_GET["key"]))
     		{
     			$key = Input::get("key");
     			$arrkey = explode(' ',$key);
     
     			$data = Konten::where('konten','LIKE','%'.$key.'%')->orWhere(function($query) use($arrkey){
     			
     
     			foreach($arrkey as $ak){
     			
     				$alias = Meta::where('kata','=',$ak)->get();
     				//$alias = DB::table('meta')->where('kata','=',$ak)->get();
     
     				$query = $query->where('konten','LIKE','%'.$ak.'%');
     				$query = $query->orWhere(function($query2) use($alias){
     					foreach($alias as $al){
     						$query2 = $query2->orWhere('konten','LIKE','%'.$al->alias.'%');
     					}
     				});
     
     			}
     			})->orderBy(DB::raw("CASE WHEN konten LIKE '$key%' THEN 1 WHEN konten LIKE '%$key%' THEN 2 WHEN 			konten LIKE '%$key' THEN 3 ELSE 4 END"));
     			$count = $data->count();
     return $data->toSql();
     
     			$data = $data->get();
     
     			
     		}
     		else
     		{
     
     		
     			$data = Konten::all();
     
     
     		}
     		return View::make('index')->with('data',$data)->with('suggestions',$suggestions);
     */
     $suggestions[1][0] = " ";
     if (isset($_GET["key"])) {
         $key = Input::get("key");
         $arrkey = explode(' ', $key);
         $data = Konten::where('konten', 'LIKE', '%' . $key . '%')->orWhere(function ($query) use($arrkey) {
             foreach ($arrkey as $ak) {
                 $alias = Meta::where('kata', '=', $ak)->orWhere('alias', '=', $ak)->get();
                 $query = $query->Where(function ($query2) use($alias, $ak) {
                     $query2 = $query2->where('konten', 'LIKE', '%' . $ak . '%')->orwhere('owner', 'LIKE', '%' . $ak . '%');
                     foreach ($alias as $al) {
                         if ($al->alias == $ak) {
                             $query2 = $query2->orWhere('konten', 'LIKE', '%' . $al->kata . '%');
                         } else {
                             $query2 = $query2->orWhere('konten', 'LIKE', '%' . $al->alias . '%');
                         }
                     }
                 });
             }
         })->orderBy(DB::raw("CASE WHEN konten LIKE '{$key}%' THEN 1 WHEN konten LIKE '%{$key}%' THEN 2 WHEN \t\t\tkonten LIKE '%{$key}' THEN 3 ELSE 4 END"));
         $count = $data->count();
         //return $data->toSql();
         $data = $data->get();
     } else {
         $data = Konten::all();
     }
     return View::make('index')->with('data', $data)->with('suggestions', $suggestions);
 }
Exemplo n.º 6
0
 public function equipe()
 {
     $metas = Meta::where('tipoEmpresa', 'Equipe')->orderBy('numeroEmpresas', 'asc');
     return view('Meta.Equipe')->with('metas', $metas);
 }
Exemplo n.º 7
0
 /**
  * Function for clients .
  * Using
  */
 public function dashboard()
 {
     $pagecode = '1o3wTvPBraUILjQZ';
     $meta = Meta::where('code', $pagecode)->firstOrFail();
     if (Auth::check()) {
         return Redirect::to('/');
         return view('core.standard', compact('meta'));
     } else {
         return Redirect::to('login');
     }
 }