/** * Fungsi buat tampilan about us */ public function aboutUs() { $about = About::first(); $gallery = Image::all(); $tipe = Type::all(); return view('FrontEnd.aboutUs', compact('about', 'gallery', 'tipe')); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($type, $id) { if ($id == 'video') { $events = Video::all(); return view('video.show', compact('events')); } elseif ($id == 'staff') { $events = Staff::all(); return view('staff.show', compact('events')); } elseif ($id == 'gallery') { $events = Image::all(); return view('gallery.show', compact('events')); } else { $event = Event::where('slug', $id)->where('type', $type)->first(); $location = Location::where('event_id', $event->id)->first(); $slider = EventImage::where('event_id', $event->id)->orderBy(\DB::raw('RAND()'))->take(4)->get(); $gallery = EventImage::where('event_id', $event->id)->first(); if ($event->type == $type) { if ($event->status == 1) { return view($type . '.show', compact('event', 'location', 'slider', 'gallery')); } else { return redirect('/' . $type . '/'); } } } }
public function index() { $images = []; foreach (Image::all() as $image) { $images[] = $image->serialize(); } return response()->json(['images' => $images]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $images = Image::all(); $images->each(function ($images) { $images->article; }); return view('admin.images.index')->with('images', $images); }
public function management() { if (User::is_admin()) { $images = Image::all(); return view('image.management', compact('images')); } else { return redirect('/')->with('message', 'you must login to open this page'); } }
/** * Display Backend Area. */ public function backend() { $users = User::where('id', '<>', 1)->get(); $categories = Category::all(); $projects = Project::all(); $images = Image::all(); $links = Link::all(); return view('pages/backend/index')->with('users', $users)->with('categories', $categories)->with('projects', $projects)->with('links', $links)->with('images', $images); }
public function index() { $images = Image::all(); /** * Por se varias imágenes se hace un recorrido */ $images->each(function ($images) { $images->article; }); return view('admin.images.index', compact('images')); }
function getExample4() { $images = \App\Image::all(); echo $images; //dump($images); foreach ($images as $image) { echo $image['narrative'] . '<br>'; } foreach ($images as $image) { echo $image->narrative . '<br>'; } }
/** * Execute the console command. * * @return mixed */ public function handle() { if ($this->option('all')) { foreach (Image::all() as $image) { $image->regenerate(); } } elseif ($this->argument('image')) { $image = Image::find($this->argument('image')); if (count($image)) { $image->regenerate(); } } }
/** * Display a listing of the resource. * * @return Response */ public function index() { // $produtos = Produto::paginate(10); //$categorias = Categoria::paginate(10); $images = Image::all(); $categorias = Categoria::all(); //own query $produtos_imgs = DB::table('produtos')->join('images', 'produtos.id', '=', 'images.produto_id')->select('produtos.*', 'images.file')->groupBy('produtos.nome')->get(); if (Auth::check()) { return view('produto.list-adm-produto', compact('produtos', 'categorias')); } else { return view('produto.list-produto', compact('produtos', 'categorias', 'images', 'produtos_imgs')); } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // obtenemos todas las imágenes // si no añadimos arriba: 'use App\Image', tendríamos // que hacerlo así: $images = \App\Image::all(); // Pero es más cómodo hacerlo de esta manera (añadiendo // arriba la llamada) $images = Image::all(); //dd($images); // Para mostrar el título del artículo // (para ello usamos el modelo de las imágenes) $images->each(function ($images) { $images->article; }); return view('admin.images.index')->with('images', $images); }
private function composeTotal() { view()->composer('partials.admin_sidebar', function ($view) { $view->with('totalusers', User::all()->count()); //total admin $view->with('totalparticipants', Participant::all()->count()); //total participant $view->with('totalevents', Event::all()->count()); //total event $view->with('totalposts', Post::all()->count()); //total post $view->with('totaltags', Tag::all()->count()); //total tag $view->with('totalimages', Image::all()->count()); //total image }); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('images')->delete(); $file = storage_path('app') . '/files/images.csv'; $images = FileParse::parse_csv($file); DB::table('images')->insert($images); $users = \App\User::all(); $db_images = \App\Image::all(); foreach ($db_images as $key => $img) { // $date = \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', '2015-11-'.mt_rand(1, 5).' '.mt_rand(0, 24).':00:00'); $user = $users[$key + 1]; $img->ip = $user->ip; $img->user_id = $user->id; $img->created_at = $user->created_at; $img->updated_at = $user->updated_at; $img->save(); } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { // if (Input::has("search")) { $target = "%" . trim(Input::get()["search"], "\"") . "%"; $images = Image::where('name', 'LIKE', $target)->get(); } else { $images = Image::all(); } if (Input::has("sort")) { if (Input::get()["sort"] == 1) { $images = $images->sortBy(function ($img) { return -sizeof($img->comments); }); } } return view("homepage", ['images' => $images]); }
/** * Display a listing of the resource. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function index(Request $request) { // Validate data $this->validate($request, ['my' => 'boolean', 'user' => 'integer|exists:user,id', 'parent_type' => 'string', 'parent_id' => 'integer']); if ($request->has('my')) { $images = Image::where('user_id', $request->user()->id)->get(); } elseif ($request->has('user')) { $images = Image::where('user_id', $request->input('user'))->get(); } elseif ($request->has('parent_type') && $request->has('parent_id')) { $images = Image::where([['parent_type', $request->input('parent_type')], ['parent_id', $request->input('parent_id')]])->get(); } else { $images = Image::all(); } if ($request->wantsJSON()) { return response()->json($images->toArray(), 200); } else { return view('pages.image.index', ['images' => $images]); } }
/** * Run the database seeds. * * @return void */ public function run() { $cities = []; $cities[] = City::where('geoname_id', 658225)->first(); $cities[] = City::where('geoname_id', 649360)->first(); $cities[] = City::where('geoname_id', 660158)->first(); $cities[] = City::where('geoname_id', 632453)->first(); $cities[] = City::where('geoname_id', 634963)->first(); $images = Image::all(); $users = User::all(); for ($i = 0; $i < 100; $i++) { $city = $cities[rand(0, count($cities) - 1)]; $image = $images[rand(0, count($images) - 1)]; $logo_image = $images[rand(0, count($images) - 1)]; $user = $users[rand(0, count($users) - 1)]; $id = DB::table('designer')->insertGetId(['city_id' => $city->id, 'image_id' => $image->id, 'logo_id' => $logo_image->id, 'user_id' => $user->id, 'email' => '*****@*****.**', 'website' => 'http://www.example.com/', 'facebook' => 'https://www.facebook.com/', 'twitter' => 'https://twitter.com/', 'google_plus' => 'https://plus.google.com/', 'instagram' => 'https://www.instagram.com/', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')]); DB::table('designer_translation')->insert(['designer_id' => $id, 'locale' => 'en', 'name' => 'Test Designer ' . $id, 'tagline' => 'Good typeface make any text easier to read', 'content' => file_get_contents('http://loripsum.net/api'), 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')]); } }
/** * Run the database seeds. * * @return void */ public function run() { $cities = []; $cities[] = City::where('geoname_id', 658225)->first(); $cities[] = City::where('geoname_id', 649360)->first(); $cities[] = City::where('geoname_id', 660158)->first(); $cities[] = City::where('geoname_id', 632453)->first(); $cities[] = City::where('geoname_id', 634963)->first(); $images = Image::all(); $users = User::all(); $types = Place::types(); for ($i = 0; $i < 100; $i++) { $city = $cities[rand(0, count($cities) - 1)]; $image = $images[$i % count($images)]; $user = $users[rand(0, count($users) - 1)]; $type = $types[rand(0, count($types) - 1)]; $id = DB::table('place')->insertGetId(['city_id' => $city->id, 'image_id' => $image->id, 'user_id' => $user->id, 'type' => $type, 'address' => 'Servinkuja 1 B 19', 'latitude' => $city->latitude + rand(0, 1000) / 20000 - 0.025, 'longitude' => $city->longitude + rand(0, 1000) / 20000 - 0.025, 'phone' => '+3581234567', 'email' => '*****@*****.**', 'website' => 'http://www.example.com/', 'facebook' => 'https://www.facebook.com/', 'google_plus' => 'https://plus.google.com/', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')]); DB::table('place_translation')->insert(['place_id' => $id, 'locale' => 'en', 'name' => 'Test ' . $type . ' ' . $id, 'content' => file_get_contents('http://loripsum.net/api'), 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')]); } }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function updateDescription($id) { $user = Auth::user(); $aboutUs = About::find($id); $aboutUs->detail = Input::get('detail'); $aboutUs->save(); $gallery = Image::all(); return Redirect('aboutUsAdmin')->with('user', 'aboutUs', 'gallery'); }
public function allImages() { $images = Image::all(); return $images; }
public function show(Request $request) { $images = Image::all(); return view('page.showLists', compact('images')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $images = Image::all(); return view('images.index', compact('images')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // $images = Image::all(); return view('images.index')->withImages($images); }
public function index() { $articles = Article::latest('published_at')->published()->get(); $images = Image::all()->unique('article_id')->pluck('image', 'article_id')->all(); return view('articles.index', compact('articles'), compact('images')); }
public function getImages() { return Image::all(); }
return view('index', ['images' => \App\Image::all(), 'services' => "Habesha provides exceptional services"]); }); Route::controller('article', 'ArticleController'); Route::controller('auth', 'Auth\\AuthController'); Route::any('/images/browse', function (Request $request) { return view('browse', ['images' => \App\Image::all(), 'CKEditorFuncNum' => $request->input('CKEditorFuncNum', '0')]); }); Route::any('/images/{id}', function ($id) { $image = \App\Image::where('id', $id)->firstOrFail(); if (!file_exists(storage_path("images/{$image->file_name}"))) { return response("Image not found on our servers!", 404); } return response()->download(storage_path("images/{$image->file_name}"), null, [], ''); }); Route::get('/images/upload', function (Request $request) { return view('upload', ['images' => \App\Image::all()]); }); Route::post('/images/upload', function (Request $request) { $message = ''; $url = ''; if ($request->hasFile('upload')) { $file = $request->file('upload'); $ext = $file->guessExtension(); $hash = md5_file($file->getPath()); $file->move(storage_path("images/"), "{$hash}.{$ext}"); \App\Image::create(['file_name' => "{$hash}.{$ext}", 'description' => $request->input('description', ""), 'alt' => $request->input('alt', "")]); $message = "Uploaded successfully! {$hash}"; } else { $message = "File not uploaded, please try again!"; } $funcNum = $_REQUEST['CKEditorFuncNum'];
public function retrieveImages() { return Image::all()->where('id_campagne', $this->id_campagne, false)->where('validation_image', 1, false); }
/** * count images * * @return int */ public function count() { return Image::all()->count(); }
public function index() { $images = Image::all(); $interests = Auth::user()->interests()->lists('name', 'id'); return view('images.index', compact('interests', 'images')); }
/** * Show the form for creating a new resource. * * @return Response */ public function create() { $images = Image::all(); return view('admin.images', compact('images')); }
$student = Student::where('card', $card)->first(); return response()->json($student); }); Route::post('images', function () { $image_encoded = Request::input('base64image'); $image = new Image(); $image->image_url = Image::saveImage($image_encoded); if ($image->image_url != false) { $image->save(); return response()->json(["image_saved" => true]); } else { return response()->json(["image_saved" => false]); } }); Route::get('images', function () { $images = Image::all(); return response()->json($images); }); Route::get('images/view', function () { return view('image_viewer'); }); Route::get('images/today', function () { $images = Image::where('created_at', '>=', date("Y-m-d"))->get(); return response()->json($images); }); Route::get('images/festember_id/{id}', function ($id) { $images = Image::where('festember_id', $id)->get(); return response()->json($images); }); Route::get('images/{name}/download', function ($name) { $storagePath = Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix();