当前位置: 首页>>代码示例>>PHP>>正文


PHP app\News类代码示例

本文整理汇总了PHP中app\News的典型用法代码示例。如果您正苦于以下问题:PHP News类的具体用法?PHP News怎么用?PHP News使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了News类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     $banners = Banner::where('active', 'Y')->orderBy('id', 'desc')->get();
     $news = News::orderBy('date', 'desc')->take(5)->get();
     $videos = Video::orderBy('id', 'desc')->take(5)->get();
     return view('home', compact('banners', 'news', 'videos'));
 }
开发者ID:RelmekTaiwan,项目名称:sebamed,代码行数:12,代码来源:HomeController.php

示例2: run

 public function run()
 {
     DB::table('news')->delete();
     $introduction = "Cras egestas non arcu quis facilisis. Etiam scelerisque felis a ante \n\t\tvehicula dignissim. Nunc nulla erat, placerat in ipsum efficitur, efficitur volutpat enim. \n\t\tIn nec lobortis sapien. Maecenas quis nunc molestie, ultrices magna nec, cursus risus. \n\t\tFusce viverra urna at blandit dignissim. Duis id porta augue, vel tempor enim. Ut eu orci dolor. ";
     $introduction1 = "Duis posuere cursus arcu, consectetur tincidunt turpis vulputate eu. \n\t\tInteger venenatis consequat turpis sit amet bibendum. Nulla nibh ex, semper nec sem sed, consectetur \n\t\ttincidunt metus. Aliquam mollis condimentum magna id tincidunt. Suspendisse pellentesque placerat \n\t\taccumsan. Sed a turpis lacus. Donec luctus lorem a turpis scelerisque tincidunt. Etiam at tellus \n\t\tsed erat elementum dictum. In sit amet nulla mattis, placerat erat non, vehicula metus. Morbi nulla \n\t\tsapien, sollicitudin non vulputate et, sodales in nisi. Donec sapien dolor, tincidunt sed ultricies \n\t\tin, ultrices sit amet ante. ";
     $content = "Quisque congue sed mauris sit amet fringilla. Pellentesque a justo mollis, \n\t\tlaoreet felis vehicula, elementum urna. Proin a nisl nec lorem mollis malesuada. Suspendisse sollicitudin \n\t\tvolutpat elementum. Mauris luctus egestas justo, nec tincidunt est luctus a. Aenean a convallis sem. \n\t\tAenean quis lorem efficitur, rutrum libero eu, efficitur nunc. Praesent eu metus pellentesque, mollis \n\t\tdui eget, interdum elit. Nulla tempus tristique eros, ut mattis leo sagittis at. Curabitur rutrum tellus \n\t\teu ex egestas, et dapibus lacus sodales. Maecenas facilisis tortor vitae neque vehicula, feugiat commodo \n\t\tnulla pulvinar. Maecenas porttitor mauris enim, sed condimentum enim varius vel. Nulla dapibus velit a \n\t\tluctus malesuada. Nam eleifend felis et porta semper. Proin blandit sem augue, in venenatis augue ultricies \n\t\tvitae. Nulla eu purus tellus.\n\rCras tempus mauris sed arcu euismod, eget ultrices nisi lobortis. Etiam \n\t\ttincidunt erat nunc, ut pretium turpis mollis et. Fusce feugiat, lectus id imperdiet rutrum, justo urna \n\t\tfinibus libero, eget dignissim erat lorem sed neque. Curabitur non nisl facilisis, venenatis risus vel, \n\t\tcommodo augue. Cras eget nisl dictum, sodales turpis eu, blandit lectus. Duis mattis est ac mi pretium \n\t\ttristique vitae non magna. Aenean dictum quis neque a volutpat. Integer convallis purus in enim tempor \n\t\tpretium. Sed sit amet diam et purus porta luctus. Sed pretium, lorem ut sodales maximus, nisl arcu \n\t\ttristique odio, nec posuere mauris metus ac justo. Pellentesque ut volutpat purus. Nulla vel ornare libero. \n\t\tSed metus massa, blandit eu lorem eu, finibus ornare arcu. Proin sagittis eu turpis sit amet scelerisque. \n\t\tPhasellus nec libero eu ipsum congue consectetur. Quisque id mattis nisl, ac porta sapien. Nulla lobortis,\n\t\tturpis at scelerisque finibus, augue neque laoreet diam, in facilisis lacus purus at libero. Ut libero \n\t\tsapien, laoreet nec lorem suscipit, efficitur tincidunt elit. Quisque mi libero, volutpat eu convallis nec, \n\t\tsemper at nulla. Sed hendrerit rhoncus nulla sit amet vestibulum. Vestibulum ante ipsum primis in faucibus \n\t\torci luctus et ultrices posuere cubilia Curae; Suspendisse diam neque, dignissim non metus maximus, \n\t\tsuscipit faucibus magna. Aenean sodales elit enim, eu laoreet dui vulputate ac. Donec sagittis dignissim \n\t\ttortor, vitae dignissim dolor ultricies eu. Vivamus rutrum vestibulum auctor. Aliquam eu orci ligula. \n\t\tQuisque at ligula ex. Suspendisse in ante eget turpis sollicitudin lobortis tincidunt sed nibh. Phasellus \n\t\telementum nibh vitae rutrum porta. Pellentesque vitae vestibulum purus. Curabitur placerat mattis tempor.";
     $news = new News();
     $news->language_id = 1;
     $news->user_id = 1;
     $news->newscategory_id = 1;
     $news->title = "Cras egestas non arcu quis facilisis";
     $news->introduction = $introduction;
     $news->content = $content;
     $news->save();
     $news = new News();
     $news->language_id = 1;
     $news->user_id = 1;
     $news->newscategory_id = 1;
     $news->title = "Fusce vel turpis ultricies";
     $news->introduction = $introduction1;
     $news->content = $content;
     $news->save();
     $news = new News();
     $news->language_id = 1;
     $news->user_id = 1;
     $news->newscategory_id = 1;
     $news->title = "Donec ligula sem, facilisis ac tristique et, imperdiet nec nisi";
     $news->introduction = $introduction;
     $news->content = $content;
     $news->save();
 }
开发者ID:ryleto,项目名称:nightjar,代码行数:31,代码来源:NewsTableSeeder.php

示例3: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show(News $news)
 {
     $news->increment('dibaca');
     $comments = Comments::orderBy('created_at', 'DESC')->get()->where('news_id', $news->id);
     $sidebar = $news->orderBy('dibaca', 'DESC')->limit(5)->get();
     $otherposts = News::orderBy('created_at', 'DESC')->where('kategori_id', $news->kategori_id)->limit(3)->get();
     return view('sowindows.show', compact(['news', 'otherposts', 'comments', 'sidebar']));
 }
开发者ID:ranugoldan,项目名称:SoWindows,代码行数:14,代码来源:HomeController.php

示例4: create

 public function create(Requests\CreateNewsRequest $request)
 {
     $title = $request->title;
     $shortdesc = $request->shortdesc;
     $content = $request->fullcontent;
     $news = new News();
     $news->title = $title;
     $news->shortdesc = $shortdesc;
     $news->content = $content;
     $news->save();
     return redirect('admin/news');
 }
开发者ID:silent-sea,项目名称:silent-sea,代码行数:12,代码来源:NewsController.php

示例5: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $news = News::findOrFail($id);
     $news->delete();
     \Flash::success('Nieuwsartikel verwijderd');
     return redirect('admin/news');
 }
开发者ID:svuvis,项目名称:oshusite,代码行数:13,代码来源:NewsController.php

示例6: index

 public function index($local = 'fa')
 {
     App::setLocale($local);
     $news = News::orderBy('id', 'Desc')->take(4)->get();
     //dd($news);
     return view('main.index', compact('news'));
 }
开发者ID:slifer2015,项目名称:tarabar,代码行数:7,代码来源:IndexController.php

示例7: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 30) as $index) {
         News::create(['user_id' => '1', 'title' => $faker->sentence(4), 'url' => $faker->slug(3), 'content' => $faker->paragraphs(8, true), 'metatitle' => '', 'metakeywords' => '', 'metadesc' => '', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now(), 'published_at' => Carbon::now()]);
     }
 }
开发者ID:vowsdesrat,项目名称:laravel,代码行数:12,代码来源:NewsTableSeeder.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     for ($i = 0; $i < 30; $i++) {
         News::Create(['title' => $faker->realText(255), 'content' => $faker->realText(), 'image' => $faker->imageUrl(), 'category_id' => $faker->numberBetween(1, 4), 'likes' => $faker->numberBetween(0, 200), 'dislikes' => $faker->numberBetween(0, 100)]);
     }
 }
开发者ID:elistone,项目名称:simple-news-api,代码行数:12,代码来源:NewsSeed.php

示例9: news

 public function news(Request $request)
 {
     if ($request->isMethod('POST')) {
         //            News::create($request->except('_token'));
         // read image from temporary file
         $file = $request->file('imagePrev');
         $img = Image::make($file->getRealPath());
         $nameFile = $file->getClientOriginalName();
         //          resize image
         $img->fit(263, 263);
         // save image
         $img->save("images/" . $nameFile);
         News::create(['text' => $request->input('editor1'), 'header' => $request->input('header'), 'picture' => "images/" . $nameFile]);
         //            switch ( $request->input('type') ) {
         //                case 'insert':
         //                    News::create($request->except('_token'));
         //                    break;
         //                case 'update':
         //                    News::find( $request->input('id') )->update([
         //                        'header' => $request->input('header'),
         //                        'text' => $request->input('editor1'),
         //                    ]);
         //                    break;
         //            }
     }
     if ($request->isMethod('GET')) {
         $item = News::find($request->input('remove'));
         if ($item) {
             $item->delete();
         }
     }
     $news = News::orderBy('created_at', 'DESC')->paginate(15);
     return view('admin/news', ['news' => $news]);
 }
开发者ID:GraninNikita,项目名称:feo,代码行数:34,代码来源:AdminController.php

示例10: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     News::firstOrCreate(['title' => "Our Awesome News!", 'featured_image' => "/images/sample_images/news/1.jpg", 'content' => "<p>Lorem Khaled Ipsum is a major key to success. Give thanks to the most high. Watch your back, but more importantly when you get out the shower, dry your back, it’s a cold world out there. They don’t want us to win. In life you have to take the trash out, if you have trash in your life, take it out, throw it away, get rid of it, major key. Lion! Eliptical talk. Congratulations, you played yourself. Cloth talk. To be successful you’ve got to work hard, to make history, simple, you’ve got to make it. Another one.</p>\n\t        <p>In life there will be road blocks but we will over come it. Lion! You smart, you loyal, you a genius. To succeed you must believe. Life is what you make it, so let’s make it. Put it this way, it took me twenty five years to get these plants, twenty five years of blood sweat and tears, and I’m never giving up, I’m just getting started. Congratulations, you played yourself. Special cloth alert. Let’s see what Chef Dee got that they don’t want us to eat.</p>", 'tags' => "blog,post,news,event,something,amazing"]);
     News::firstOrCreate(['title' => "Darragh Has Come To Save Us All", 'featured_image' => "/images/sample_images/news/2.jpg", 'content' => "Lorem ipsum Dolor nulla veniam et dolor anim cupidatat exercitation dolore Duis sunt voluptate ea quis velit Ut dolore ut dolor cillum. Lorem ipsum Sint officia aliquip culpa ea exercitation sint exercitation Ut exercitation nulla Ut non adipisicing officia veniam ut incididunt commodo et dolor tempor labore commodo esse amet nostrud nisi elit cillum laborum tempor do minim consectetur Excepteur dolore dolor enim quis ea esse Ut eu sit reprehenderit cillum in est tempor pariatur dolore culpa cupidatat fugiat nostrud incididunt sit velit voluptate consequat dolor dolor cillum dolore qui Excepteur officia et elit nisi dolore culpa esse Ut aute ut esse sed id sed tempor incididunt nostrud cillum irure nostrud laboris tempor amet commodo minim incididunt sunt laboris enim ut labore consequat in exercitation laborum dolore ad sed dolore non incididunt sint ea esse quis exercitation dolore ullamco occaecat dolor pariatur qui eu enim adipisicing adipisicing ex labore sunt eu pariatur ex sit qui sit eu ex esse cillum dolore in elit ullamco sint est aliquip esse Duis in aute esse culpa irure sed Excepteur id non do cillum sit voluptate irure tempor commodo consequat exercitation do in labore enim sed aute quis laboris sit commodo sint officia dolor ut amet ea tempor id in commodo nisi incididunt qui sed magna Ut in aliquip magna amet et ut Excepteur amet aliquip cillum qui ut fugiat irure Ut qui laboris dolore Ut officia elit enim mollit enim incididunt sint ex deserunt ut consequat elit et dolore.", 'tags' => "blog,post,news,event,something,amazing"]);
     News::firstOrCreate(['title' => "You are no more than two events away from pizza", 'featured_image' => "/images/sample_images/news/3.jpg", 'content' => "Lorem ipsum Sint exercitation elit minim quis in ad sit proident do velit cillum veniam consequat amet in Excepteur in labore cillum nostrud occaecat veniam pariatur exercitation exercitation. Lorem ipsum Ad sed elit ut non non laborum Ut exercitation deserunt voluptate anim consequat aute ut Excepteur nostrud ut mollit irure sed velit ut qui ut do ullamco velit ea dolor laboris nostrud officia incididunt do eu fugiat in enim veniam tempor labore in et sint dolor reprehenderit et sit irure veniam dolore nulla cillum pariatur sint incididunt aliquip incididunt in velit amet do do pariatur Ut ex nulla eu velit commodo veniam minim qui esse proident elit minim dolor sit ex veniam Excepteur sed commodo qui ad adipisicing ea aute tempor nostrud dolor quis in enim do consequat ut sed do consectetur voluptate voluptate tempor eiusmod eiusmod in dolore culpa ut in commodo id aute exercitation sint labore cillum amet nostrud ex anim sed ut sint do eiusmod eu irure quis commodo dolor reprehenderit laborum in ut quis reprehenderit nulla eiusmod do Excepteur Ut mollit velit minim Excepteur dolor ut anim incididunt elit ullamco sed amet adipisicing in Ut ea elit esse ex laborum elit tempor mollit enim aliqua adipisicing in commodo do cillum ex commodo Excepteur exercitation mollit enim aliquip ad qui ea tempor consectetur ad nostrud Excepteur occaecat reprehenderit officia dolore labore labore dolore dolor officia amet ullamco eiusmod aliqua commodo cupidatat proident cillum in ex nostrud id pariatur enim sint deserunt sed cupidatat ex ea in dolore Duis Duis aliquip enim pariatur nisi ea enim commodo labore eiusmod qui labore non consectetur exercitation minim dolore magna tempor esse amet mollit irure proident dolore irure aliqua non fugiat eu.", 'tags' => "blog,post,news,event,something,amazing"]);
     News::firstOrCreate(['title' => "Maybe 4AM isn't the best time to be writing code", 'featured_image' => "/images/sample_images/news/4.jpg", 'content' => "Lorem ipsum Velit cupidatat proident nulla voluptate aliqua qui ut amet amet qui sint nisi commodo mollit in qui magna in sed proident Ut et nisi id occaecat eiusmod voluptate qui velit id irure pariatur amet cillum eu aute et magna amet aute in mollit sed velit laborum elit incididunt ex aliquip ad velit tempor ullamco officia quis exercitation sit ut consequat ex veniam proident voluptate proident eiusmod dolor veniam dolor elit sit commodo in fugiat Ut deserunt laborum qui ut ad veniam aliqua aute irure sit commodo dolor ut occaecat sed cillum consectetur exercitation commodo elit aliquip aliquip quis cillum ut id in officia Ut ullamco qui cillum veniam ex officia cupidatat deserunt deserunt tempor commodo voluptate qui ut aliquip minim in nulla dolor nostrud voluptate sit culpa proident sunt id minim elit et aliquip ex minim incididunt reprehenderit magna proident Excepteur minim.", 'tags' => "blog,post,news,event,something,amazing"]);
 }
开发者ID:TheJokersThief,项目名称:Eve,代码行数:12,代码来源:NewsSeeder.php

示例11: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($tag)
 {
     $articles = News::withAnyTag($tag)->get();
     $artworks = Artwork::withAnyTag($tag)->get();
     $events = Event::withAnyTag($tag)->get();
     return View::make('tags/show', compact('articles', 'artworks', 'events', 'tag'));
 }
开发者ID:VincentVanWijk,项目名称:artotheek5,代码行数:13,代码来源:TagsController.php

示例12: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $u = User::create(['first_name' => 'test', 'last_name' => 'test', 'email' => 'test@test.fr', 'level' => 1]);
     $u2 = User::create(['first_name' => 'test2', 'last_name' => 'test2', 'email' => 'test2@test.fr', 'level' => 1]);
     $u3 = User::create(['first_name' => 'test3', 'last_name' => 'test3', 'email' => 'test3@test.fr', 'level' => 2]);
     $e1 = Event::create(['name' => 'test event', 'user_id' => 3, 'slug' => 'test-event-1', 'date' => '2016-10-17', 'start' => '18:00:00', 'end' => '5:00:00']);
     $e2 = Event::create(['name' => 'test event', 'user_id' => 1, 'slug' => 'test-event-2', 'date' => '2016-08-22', 'start' => '19:00:00', 'end' => '5:00:00']);
     Event::create(['name' => 'test event', 'user_id' => 2, 'slug' => 'test-event-3', 'date' => '2017-01-07', 'start' => '18:00:00', 'end' => '5:00:00']);
     $p1 = Playlist::create(['name' => 'Playlist principale !']);
     $p2 = Playlist::create(['name' => 'The Playlist !']);
     $p3 = Playlist::create(['name' => 'Playlist secondaire']);
     Playlist::create(['name' => 'The Playlist !']);
     $p1->styles()->sync([1, 2, 3]);
     $p2->styles()->sync([1, 4]);
     $p3->styles()->sync([1, 3, 5, 7]);
     $e1->playlists()->sync([1, 3]);
     $e2->playlists()->sync([2]);
     Comment::create(['event_id' => 2, 'user_id' => 2, 'content' => 'Sooo goooood']);
     Comment::create(['event_id' => 3, 'user_id' => 2, 'content' => 'Sooo goooood :D']);
     Comment::create(['event_id' => 2, 'user_id' => 3, 'content' => 'Sooo goooood !!!']);
     Video::create(['url' => '7l48bfQuJeE', 'artist' => 'Chill Bump', 'name' => 'Lost In The Sound', 'tags' => 'chill bump lost in the sound']);
     Video::create(['url' => 'XxdPJvhQaMU', 'artist' => 'Chill Bump', 'name' => 'Water boycotter', 'tags' => 'chill bump water boycotter']);
     Video::create(['url' => 'kWXAYDQ_K7k', 'artist' => 'Chill Bump', 'name' => 'The Memo', 'tags' => 'chill bump the memo']);
     $pivot1 = $p1->videos()->sync([1, 3]);
     $pivot2 = $p2->videos()->sync([2]);
     $pivot3 = $p3->videos()->sync([1, 2, 3]);
     News::create(['title' => 'news test', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ', 'user_id' => 2, 'slug' => 'text-news-1']);
     News::create(['title' => 'news test 2', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ', 'user_id' => 3, 'slug' => 'text-news-2']);
     Article::create(['title' => 'Article test 1', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ', 'user_id' => 2, 'slug' => 'text-article-1']);
     Article::create(['title' => 'Article test 2', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ', 'user_id' => 3, 'slug' => 'text-article-2', 'event_id' => 2]);
 }
开发者ID:Techraav,项目名称:djMaker,代码行数:36,代码来源:2017_06_10_032123_create_base_entries.php

示例13: show

 public function show($id)
 {
     $news = News::find($id);
     $news->visit++;
     $news->save();
     return view('news.show')->withNavSelection(3)->withTagSelection(-1)->withNews($news);
 }
开发者ID:AranKyun,项目名称:SKLSE-website,代码行数:7,代码来源:NewsController.php

示例14: vacations

 public function vacations($vacation)
 {
     if ($vacation == 'winter') {
         $programs = Program::where('programs.active', '=', '1')->join('vacations', 'programs.id', '=', 'vacations.program_id')->where('vacations.season', '=', 'Зима')->orderBy('programs.id', 'desc')->select('programs.*', 'vacations.start_date as start_date', 'vacations.finish_date as finish_date')->get();
     } elseif ($vacation == 'spring') {
         $programs = Program::where('programs.active', '=', '1')->join('vacations', 'programs.id', '=', 'vacations.program_id')->where('vacations.season', '=', 'Весна')->orderBy('programs.id', 'desc')->select('programs.*', 'vacations.start_date as start_date', 'vacations.finish_date as finish_date')->get();
     } elseif ($vacation == 'summer') {
         $programs = Program::where('programs.active', '=', '1')->join('vacations', 'programs.id', '=', 'vacations.program_id')->where('vacations.season', '=', 'Лето')->orderBy('programs.id', 'desc')->select('programs.*', 'vacations.start_date as start_date', 'vacations.finish_date as finish_date')->get();
     } elseif ($vacation == 'autumn') {
         $programs = Program::where('programs.active', '=', '1')->join('vacations', 'programs.id', '=', 'vacations.program_id')->where('vacations.season', '=', 'Осень')->orderBy('programs.id', 'desc')->select('programs.id as id', 'vacations.start_date as start_date', 'vacations.finish_date as finish_date')->get();
     } elseif ($vacation == 'weekend') {
         $programs = Program::where('programs.active', '=', '1')->join('vacations', 'programs.id', '=', 'vacations.program_id')->where('vacations.season', '=', 'Выходной')->orderBy('programs.id', 'desc')->select('programs.*', 'vacations.start_date as start_date', 'vacations.finish_date as finish_date')->get();
     } elseif ($vacation == 'festival') {
         $programs = Program::where('programs.active', '=', '1')->join('vacations', 'programs.id', '=', 'vacations.program_id')->where('vacations.season', '=', 'Фестиваль')->orderBy('programs.id', 'desc')->select('programs.*', 'vacations.start_date as start_date', 'vacations.finish_date as finish_date')->get();
     } else {
         $programs = Program::where('programs.active', '=', '1')->join('vacations', 'programs.id', '=', 'vacations.program_id')->orderBy('programs.id', 'desc')->select('programs.*', 'vacations.start_date as start_date', 'vacations.finish_date as finish_date')->get();
     }
     $all_news = News::where('active', '=', '1')->get();
     $monthes = array(1 => 'Января', 2 => 'Февраля', 3 => 'Марта', 4 => 'Апреля', 5 => 'Мая', 6 => 'Июня', 7 => 'Июля', 8 => 'Августа', 9 => 'Сентября', 10 => 'Октября', 11 => 'Ноября', 12 => 'Декабря');
     if (Auth::check()) {
         $user = Auth::user()->name;
     } else {
         $user = 'guest';
     }
     return view('index', ['programs' => $programs, 'monthes' => $monthes, 'all_news' => $all_news, 'user' => $user]);
 }
开发者ID:savitskayads,项目名称:skillcamp,代码行数:26,代码来源:IndexController.php

示例15: destroy

 public function destroy($id)
 {
     $news = News::FindOrfail($id);
     $news->delete();
     session()->flash('flash_message', 'Je artikel is succesvol verwijderd');
     return redirect('news');
 }
开发者ID:jordygroote,项目名称:detoekomstapp,代码行数:7,代码来源:NewsController.php


注:本文中的app\News类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。