public function goUrl($slug, Slider $slider, Pages $pages) { $this->data['slides'] = $slider->getActive(); $this->data['content'] = $pages->getActive($slug); //dd( $this->data['content']); return view('pages.page', $this->data); }
public function getBasked(Products $products, Slider $slider, Delivery $delivery) { if (Session::get('product')) { $this->data['delivery'] = $delivery->getDeliveryActive(); $productsBasked = Session::get('product'); $this->data['countProducts'] = collect($productsBasked); $productsId = ''; $k = 0; foreach ($productsBasked as $id) { if ($k == 0) { $productsId = $id['id']; $k++; } else { $productsId = $productsId . ' ,' . $id['id']; } } $this->data['bascedProducts'] = collect($products->getBascedProducts($productsId)); } else { $this->data['bascedErrr'] = 'Корзина пуста'; } $this->data['slides'] = $slider->getActive(); $this->data['products'] = $products->getActive(); if (\Auth::user()) { $this->data['name'] = \Auth::user()->name; $this->data['address'] = \Auth::user()->address; $this->data['email'] = \Auth::user()->email; $this->data['number'] = \Auth::user()->number; } return view('pages.cart', $this->data); }
public function index(Slider $slider, Blog $blog) { $this->data['slider'] = $slider->getActiveSliders(); $this->data['blogsContent'] = $blog->getFewBlogs(2); $this->data['content'] = json_decode(file_get_contents(storage_path() . '/administrator_settings/main.json')); return view('pages.main', $this->data); }
public function search(Slider $slider, Products $products) { $search = Input::all(); $search = $this->parsing($search['search']); $this->data['products'] = $products->searchProduct($search); $this->data['slides'] = $slider->getActive(); return view('pages.index', $this->data); }
public function index(Slider $slider, Blog $blog, Product $shop, Section $section) { $slides = $slider->getActive(); $posts = $blog->getActive(); $products = $shop->getPopular(); // dd($products); $sections = $section->getSection(); // var_dump(\Session::get('product8')); return view('pages.index', ['slides' => $slides, 'posts' => $posts, 'products' => $products, 'sections' => $sections]); }
/** * Store a newly created resource in storage. * * @param Requests\CreateEditSliderRequest $request * @param StoreFile $storeFile * @param \App\Slider $slider * @return \Illuminate\Http\RedirectResponse */ public function store(Requests\CreateEditSliderRequest $request, StoreFile $storeFile, \App\Slider $slider) { //Creating and moving the file image $image_path = $storeFile->move($request->file('image'), 'public/images/sliders/', 16); //Adding the image file path to the array of request $modified_request = array_merge($request->except('image'), ['image' => $image_path]); //Storing $slider->create($modified_request); //Redirect return redirect()->action('Panel\\SliderController@index'); }
public function home() { $categories = $this->categories->get()->linkNodes()->toTree(); $products = $this->products->featured()->paginate(8); $sliders = Slider::all(); return view('frontend.home', compact('categories', 'products', 'sliders')); }
/** * Insert images into database * * @return void */ private function create_image($image, $type) { $extension = $image->getClientOriginalExtension(); $slider = Slider::create(['image' => '']); $image->move('img/' . $type . '/', $slider->id . '.' . $extension); $slider->update(['image' => 'img/' . $type . '/' . $slider->id . '.' . $extension, 'type' => $type]); }
public function destroy($id) { $slider = Slider::whereId($id)->first(); unlink('uploads/' . $slider->slider_image); $slider->delete(); return redirect('/slider/all'); }
public function welcome(Service $serviceModel) { $sliders = Slider::all(); $services = $serviceModel->getService(); $page = Page::where('name', '=', 'home')->firstOrFail(); return view('welcome')->with('sliders', $sliders)->with('services', $services)->with('page', $page); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index($id) { $product = Product::where('id', $id)->get()[0]; $sliders = Slider::all(); $categories = Category::all(); return view('product', compact('sliders', 'categories', 'product')); }
public function store(Request $request) { $extension = Input::file('avatar')->getClientOriginalExtension(); // getting image extension $fileName = Uuid::generate() . '.' . $extension; // renameing image \Intervention\Image\Facades\Image::make(Input::file('avatar'))->resize(1000, 220)->save(public_path('elmphoto/sliders/' . $fileName)); //resmi kuçult $image = new Slider(); $image->title = $request->title; $image->name = $fileName; $image->user_id = Auth::user()->id; $image->save(); flash('Güncelleme işlemi başarıyla gercekleşti.', 'info'); return redirect()->back(); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $slider = Slider::findOrFail($id); $slider->delete(); Flash::success('Slider verwijderd'); return redirect('admin/sliders'); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $slider = Slider::findOrFail($id); unlink(base_path() . '/public/images/slider/' . $slider->picture); Slider::destroy($id); return redirect(route('admin.sliders.index'))->with('success', 'L\'image a bien été supprimée'); }
public function index() { Carbon::setLocale('nl'); $news = News::latest()->take(3)->get(); $sliders = Slider::all(); return view('pages.public.index', compact('news', 'sliders')); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $image = Slider::findOrFail($id); $image->delete(); flash()->warning('Slider telah dihapus!'); return redirect('/dashboard/sliders'); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $sliders = Slider::latest()->get(); $images = Image::latest()->take(4)->get(); $news = News::latest('published_at')->published()->take(3)->get(); $articles = Article::latest('published_at')->published()->take(3)->get(); return view('pages.index', compact('articles', 'news', 'images', 'sliders')); }
public function index() { $events = \App\Event::get(); $sliders = \App\Slider::get(); $services = \App\Service::get(); $site = \App\Site::where('active', '1')->firstOrFail(); return view('pages.index', ['events' => $events, 'sliders' => $sliders, 'services' => $services, 'site' => $site]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // //App::setLocale('kh'); //return trans('administrators.dashboard'); //$user = Auth::user(); //return $user->toJson(); return View('admin.dashboard')->with(['user_total' => \App\User::count(), 'content_total' => \App\Content::count(), 'category_total' => \App\Category::count(), 'slider_total' => \App\Slider::count()]); }
public function delete($id) { $slide = Slider::find($id); if (isset($slide) && !empty($slide)) { Slider::where('id', $id)->update(['trash' => 1]); return Redirect::route('slider')->with(['msg' => 'Deleted successfully!']); } return Redirect::route('slider')->with(['msg' => 'Failed to delete!']); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $sliders = Slider::all(); $categories = Category::all(); $products = Product::orderBy('id', 'desc')->take(12)->get(); $discount_products = Product::where('discount', '=', 'true')->take(12)->get(); $random_products = Product::orderByRaw("RAND()")->take(10)->get(); return view('home', compact('sliders', 'categories', 'products', 'discount_products', 'random_products')); }
public function index() { $activities = Activity::all()->take(2); $title = trans('default.home'); $locale = App::getLocale(); $homeText = HomeText::first(); $sliders = Slider::all(); return view('pages.index', compact('title', 'activities', 'locale', 'homeText', 'sliders')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $dataSlider = Slider::all(); $dataFirst = Slider::first(); $dataBanner = Banner::all(); $produk = Produk::paginate(2); $tipe = Type::all(); return view('FrontEnd.home', compact('dataSlider', 'dataFirst', 'dataBanner', 'produk', 'tipe')); }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(PostSliderRequest $request) { $file = $request->file('image'); $extension = $file->getClientOriginalExtension(); $filename = str_slug($request->name) . '-' . time() . '.' . $extension; $img = \Image::make($file)->resize(823, 463)->save('uploads/sliders/' . $filename); Slider::Create(['name' => $request['name'], 'image' => $filename, 'expired_at' => $request['expired_at']]); Session::flash('message', 'Você cadastrou um banner com sucesso!'); return redirect()->route('dashboard.slider.index'); }
public function delete($id) { $entry = Slider::find($id); if (isset($entry)) { Slider::where('id', $id)->update(array('trash' => 1)); return \Redirect::route('slider')->with('success', $entry->title . ' deleted succesfully!'); } else { return \Redirect::route('slider')->with('error', 'Failed to delete, invalid credentials.'); } }
public function index() { $limit = 2; $announcement = Announcement::orderBy('created_at', 'desc')->limit($limit)->get(); $now = new Datetime(); $now = $now->format('Y-m-d'); $upcomingTrainings = Training::where('status', '=', 1)->where('start_date', '>', Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $now . ' 00:00:00'))->orderBy('start_date', 'asc')->limit($limit)->get(); $ongoingTrainings = Training::where('status', '=', 1)->where('start_date', '<=', Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $now . ' 00:00:00'))->where('end_date', '>=', Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $now . ' 00:00:00'))->limit($limit)->get(); $all_slider = Slider::orderBy('position', 'asc')->get(); return view('bard_frontend.index', compact('announcement', 'upcomingTrainings', 'ongoingTrainings', 'all_slider')); }
public function index() { $cart = \Session::get('cart'); $itemactive = Slider::where('order', 1)->first(); $items = Slider::all(); //Obtener todos los items para el banner Atraves del modelo y extenderlo hasta partials/slider $products = Product::all(); //Obtener todos los productos Atraves del modelo //dd($products); //Herramienta de laravel que muestra los datos en el modo debug return view('store.index', compact('products', 'items', 'itemactive', 'cart')); //Envia los datos a la vista }
public function run() { DB::table('sliders')->truncate(); Model::unguard(); $css_main = 'slidedirection: right; transition2d: 92,93,105;'; $css_1 = 'color: #fff; padding: 5px 15px; background-color: #ec1f27; font-weight: 100; font-size: 25px; top:145px; left: 15px; slidedirection : top; slideoutdirection : bottom; durationin : 1000; durationout : 1000;'; $css_2 = 'opacity: 0.9; padding: 5px 15px; font-size:25px; top:200px; left: 15px; slidedirection : bottom; slideoutdirection : bottom; durationin : 2000; durationout : 2000;'; $css_3 = 'top:110px; left: 770px; slidedirection : right; slideoutdirection : bottom; durationin : 3000; durationout : 3000;'; Slider::create(['file_main' => '1.jpg', 'file_logo' => '1.png', 'url' => '#', 'text_1' => 'Sika - компанія зі 100-річною історією', 'text_2' => 'Інновації та стабільність', 'css_main' => $css_main, 'css_1' => $css_1, 'css_2' => $css_2, 'css_3' => $css_3, 'order' => 1]); Slider::create(['file_main' => '2.jpg', 'file_logo' => '2.png', 'url' => '#', 'text_1' => 'Sika - компанія зі 100-річною історією', 'text_2' => 'Інновації та стабільність', 'css_main' => $css_main, 'css_1' => $css_1, 'css_2' => $css_2, 'css_3' => $css_3, 'order' => 2]); Slider::create(['file_main' => '3.jpg', 'file_logo' => '3.png', 'url' => '#', 'text_1' => 'Sika - компанія зі 100-річною історією', 'text_2' => 'Інновації та стабільність', 'css_main' => $css_main, 'css_1' => $css_1, 'css_2' => $css_2, 'css_3' => $css_3, 'order' => 3]); Model::reguard(); }
public function decrease_slider_position($position) { $number_of_slider = Slider::all()->count(); if ($position < $number_of_slider) { $current_id = Slider::wherePosition($position)->first()->id; $next_id = Slider::wherePosition($position + 1)->first()->id; $current_slider = Slider::whereId($current_id)->first(); $current_slider->position = $position + 1; $current_slider->save(); $next_slider = Slider::whereId($next_id)->first(); $next_slider->position = $position; $next_slider->save(); } return redirect('slider/all'); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Slider()); $this->filter->add('active', 'Active', 'select')->options(\App\Slider::lists("Active", "active")->all()); $this->filter->add('weight', 'Weight', 'text'); $this->filter->add('img_url', 'Image', 'text'); $this->filter->submit('search'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('active', 'Active', 'active'); $this->grid->add('weight', 'Weight', 'weight'); $this->grid->add('img_url', 'Image'); $this->addStylesToGrid(); return $this->returnView(); }