Пример #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     \Model\Channel\ModelName::truncate();
     \Model\Channel\ModelName::create(['id' => 1, 'name' => 'general', 'display' => 'Главная', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 2, 'name' => 'ktr', 'display' => 'КТР', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 3, 'name' => 'muzkanal', 'display' => 'Муз Канал', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 4, 'name' => 'balastan', 'display' => 'Баластан', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 5, 'name' => 'madaniyat', 'display' => 'Маданият', 'published' => true]);
 }
Пример #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     \Model\Channel\ModelName::truncate();
     \Model\Channel\ModelName::create(['id' => 1, 'name' => 'general', 'display' => 'Общий', 'file' => 'images/logo_notext.png', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 2, 'name' => 'ktrk', 'display' => 'КТРК', 'file' => 'img/icons/2.svg', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 3, 'name' => 'muzkanal', 'display' => 'Музыка', 'file' => 'img/icons/3.png', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 4, 'name' => 'balastan', 'display' => 'Баластан', 'file' => 'img/icons/4.png', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 5, 'name' => 'madaniyat', 'display' => 'Маданият', 'file' => 'img/icons/5.png', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 6, 'name' => 'kyrgyzradio', 'display' => 'Кыргыз Радио', 'file' => 'img/icons/6.png', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 7, 'name' => 'birinchi', 'display' => 'Биринчи Радио', 'file' => 'img/icons/7.png', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 8, 'name' => 'dostuk', 'display' => 'Достук', 'file' => 'img/icons/8.png', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 9, 'name' => 'minkiyal', 'display' => 'Мин Кыял', 'file' => 'img/icons/9.png', 'published' => true]);
     \Model\Channel\ModelName::create(['id' => 10, 'name' => 'baldar', 'display' => 'Балдар', 'published' => true]);
 }
Пример #3
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $channel = Channel::create($request->except('file'));
     if ($request->hasFile('file')) {
         $file = $request->file('file');
         $dir = 'img/icons';
         $name = $channel->id() . '.' . $file->getClientOriginalExtension();
         $storage = \Storage::disk('public');
         $storage->makeDirectory($dir);
         // $storage->put($dir.'/'.$name, $file);
         $channel->file = $dir . '/' . $name;
         $channel->save();
         $file->move($dir, $name);
     }
     return redirect()->route('admin.channel.index');
 }
Пример #4
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     Channel::create($request->all());
     return redirect()->route('admin.channel.index');
 }