/** * Удаление типа * * @param Type $type * @return \Illuminate\Http\RedirectResponse * @throws \Exception */ public function delete(Type $type) { if (Organization::where('type_id', $type->id)->exists()) { dd('Есть организации с таким типом'); } $type->delete(); return redirect()->route('admin::type'); }
public function deactivate($id) { $type = Type::find($id); $type->status = 0; $type->save(); return redirect('home/types'); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $warehouse = Warehouse::findOrFail($id); $activities = Activity::lists('name', 'id'); $types = Type::lists('name', 'id'); return view('warehouses.edit', compact('warehouse', 'activities', 'types')); }
/** * Show the form for editing the specified resource. * * @param Venue $venue * @return Response * @internal param int $id */ public function edit(Venue $venue) { $features = Feature::lists('feature', 'id'); $cities = City::lists('name', 'id'); $types = Type::lists('type', 'id'); return view('venues.edit', compact('venue', 'features', 'cities', 'types')); }
public static function getSideBarFE() { if (Cache::has('side_bar_FE')) { $sideBar = Cache::get('side_bar_FE'); } else { $controllerType = new Type(); $controller4mat = new Format_cd(); $sideBar = $controllerType->sideBar(); $sideBar .= '<li class="sidebar-brand"><a href="#">'; $sideBar .= 'Format CD'; $sideBar .= '</a></li>'; $sideBar .= $controller4mat->sideBar(); Cache::forever('side_bar_FE', $sideBar); } return $sideBar; }
/** * Run the database seeds. * * @return void */ public function run() { //Truncate DB::statement('SET FOREIGN_KEY_CHECKS=0;'); User::truncate(); Admin::truncate(); Customer::truncate(); Address::truncate(); Category::truncate(); Product::truncate(); Brand::truncate(); Type::truncate(); Image::truncate(); DB::statement('TRUNCATE category_product;'); Product::clearIndices(); Product::reindex(); //Unguard Model::unguard(); //Call $this->call(UsersTableSeeder::class); $this->call(ProductsTableSeeder::class); //Reguard Model::reguard(); DB::statement('SET FOREIGN_KEY_CHECKS=1;'); }
public function index() { $types = Type::All(); $units = Unit::All(); $formulas = Formula::All(); return compact('types', 'units', 'formulas'); }
public function edit($id) { $aux = \App\Type::all(); $types = $this->getTypes($aux); $ingredient = Ingredient::find($id); return view('ingredient.edit', ['ingredient' => $ingredient, 'types' => $types]); }
public function destroy(Request $request) { foreach ($request->input('to_delete') as $item_id) { Type::destroy($item_id); } return Redirect::to('types'); }
public function run() { $types = ['Bar', 'Pub', 'Music Venue', 'Deli', 'Off-License', 'Restaurant', 'Brewery', 'Other']; foreach ($types as $type) { Type::create(['type' => $type]); $this->command->info('Creating ' . $type); } }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Brand $brand) { // Edit an exisiting brand $statuses = Status::lists('name', 'id'); $types = Type::whereIn('tablename', ['all', 'brands'])->lists('name', 'id'); $users = User::lists('name', 'id'); return view('brands.edit', compact('brand', 'statuses', 'users', 'types')); }
/** * Show the form for creating a new resource. * * @return Response */ public function create() { if (Auth::user()) { $types = \App\Type::orderBy('name', 'asc')->get(); return view('jobs.create', compact('types')); } return redirect('login'); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('types')->truncate(); Type::create(['name' => '教师', 'slug' => 'teacher']); Type::create(['name' => '学生', 'slug' => 'student']); Type::create(['name' => '校友', 'slug' => 'alumni']); Type::create(['name' => '其他社会人士', 'slug' => 'other']); }
public function run() { $cats = [['title' => 'catering'], ['title' => 'bar']]; foreach ($cats as $cat) { $c = Type::create([]); Seo::create(['title' => ucfirst($cat['title']), 'slug' => $cat['title'], 'seoble_type' => 'App\\Type', 'seoble_id' => $c->id]); } }
public function addProduct() { $page = 'partials.admin-addProduct'; $users = User::all(); $types = Type::all(); $brands = Brand::all(); return view('quantri/admin', compact('page', 'users', 'brands', 'types')); }
public function getList() { $vehicules = Vehicule::all(); $membres = User::all(); $modeles = Modele::all(); $types = Type::all(); return view('backoffice.vehicules', compact("vehicules", "membres", "modeles", "types")); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Stack $stack) { // Edit an exisiting stack $brands = Brand::lists('short_name', 'id'); $banks = Bank::lists('name', 'id'); $types = Type::whereIn('tablename', ['all', 'stacks'])->lists('name', 'id'); return view('stacks.edit', compact('stack', 'brands', 'banks', 'users', 'types')); }
public function run() { $types = [['icon' => 'cube', 'title' => 'portfolio', 'shorturl' => 'j.mp/pf-vdhjonas'], ['icon' => 'newspaper2', 'title' => 'blog', 'shorturl' => 'http://j.mp/blg-vdhjonas']]; foreach ($types as $type) { $t = Type::create(['icon' => $type['icon']]); Seo::create(['title' => $type['title'], 'slug' => $type['title'], 'title_en' => $type['title'], 'slug_en' => $type['title'], 'shorturl' => $type['shorturl'], 'seoble_id' => $t->id, 'seoble_type' => 'App\\Type']); } }
public function index() { View::share(['title' => 'Product management', 'sideBar' => NavigatorHelper::getSideBarBE()]); $type = Type::all(['id', 'name'])->toArray(); $format = Format_cd::all(['id', 'name'])->toArray(); $price_groups = Price_group::all(['id', 'name', 'root_price', 'price'])->toArray(); return view('catalog.product.list')->with(['type' => $type, 'format' => $format, 'price_groups' => $price_groups]); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('types')->delete(); $types = array(['description' => 'Walking'], ['description' => 'Running'], ['description' => 'Swimming'], ['description' => 'Kayaking'], ['description' => 'Cycling']); foreach ($types as $type) { Type::create($type); } }
/** * Display a listing of the resource. * * @return Response */ public function index() { $user = Auth::user(); $aboutUs = About::first(); $gallery = Image::all(); $tipe = Type::all(); return view('admin.about', compact('user', 'aboutUs', 'gallery')); }
/** query responsibility */ public function getPractice() { //this returns the collection $type = \App\Type::orderBy('id', 'DESC')->get(); //now $type is the collection, and we can work from within that, like so. $first = $type->first(); dump($type); dump($first); }
/** * Run the database seeds. * * @return void */ public function run() { // $faker = Faker\Factory::create('it_IT'); Type::create(['name' => 'Anime', 'slug' => 'anime', 'is_published' => 1]); Type::create(['name' => 'manga', 'slug' => 'manga', 'is_published' => 1]); Type::create(['name' => 'Videogames', 'slug' => 'videogames', 'is_published' => 1]); Type::create(['name' => 'Fumetti americani', 'slug' => 'fumetti-americani', 'is_published' => 1]); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('types')->delete(); Type::create(array('type_name' => 'Mobile phone')); Type::create(array('type_name' => 'Desktop')); Type::create(array('type_name' => 'Laptop')); Type::create(array('type_name' => 'Camera')); Type::create(array('type_name' => 'Television')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Activity $activity) { // Edit an exisiting activity $statuses = Status::lists('name', 'id'); $leads = Lead::lists('firstname', 'id'); $types = Type::lists('name', 'id'); $users = User::lists('name', 'id'); return view('activities.edit', compact('activity', 'statuses', 'types', 'users', 'leads')); }
/** * Run the database seeds. * * @return void */ public function run() { //for($i = 0, i < 100, i++){} $type_id = \App\Type::where('type', '=', 'Neighborhood casual')->pluck('id'); $fc_perc = \App\Type::where('id', '=', '3')->pluck('fc_perc_t'); $bc_perc = \App\Type::where('id', '=', '3')->pluck('bc_perc_t'); $lc_perc = \App\Type::where('id', '=', '3')->pluck('lc_perc_t'); $qfac_perc = \App\Type::where('id', '=', '3')->pluck('qfac_perc_t'); DB::table('proformas')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'proj_name' => "John Harvards", 'food_sales' => 30000, 'bev_sales' => 15000, 'tl_sales' => 'food_sales' + 'bev_sales', 'fc_doll' => 'food_sales' * 'fc_perc', 'bc_doll' => 'bev_sales' * 'bc_perc', 'lc_doll' => 'tl_sales' * 'lc_perc', 'qfac_doll' => 'tl_sales' * 'qfac_perc', 'tot_vcost' => 'fc_doll' + 'bc_doll' + 'lc_doll', 'tot_vcost_perc' => 'tot_vcost' / 1, 'rent' => 0, 'other_fx_cost' => 0, 'g_a' => 'tl_sales' * 0.02, 'tot_fx_cost' => 'rent' + 'other_fx_cost' + 'g_a', 'pretax_prof' => 'tl_sales' - ('tot_vcost' + 'tot_fx_cost'), 'tax_rate' => 0.33, 'tot_prof' => 'pretax_prof' - 'pretax_prof' * 'tax_rate', 'bep_doll' => 'tot_fx_cost' / 1, 'avg_check' => 35, 'bep_cov' => 'bep_doll' / 1]); }
public function create() { $types = Type::all('id', 'name'); $typeList = Item::getTypeList(); if (count($typeList) < 2) { return redirect()->action('TypeController@index')->with('message', 'Anda belum memasukan data jenis produk'); } else { return view('item.create', compact('typeList')); } }
/** * Get the validation rules that apply to the request. * * @return array */ public function rules() { switch ($this->method()) { case 'POST': return ['name' => 'required|max:255|unique:types,name']; case 'PATCH': $type = Type::find($this->types); return ['name' => 'required|max:255|unique:types,name,' . $type->id]; } }
public static function getTypeList() { $types = Type::all('id', 'name'); $typeList = array(); $typeList = array_add($typeList, "", "Jenis Barang"); foreach ($types as $type) { $typeList = array_add($typeList, $type->id, $type->name); } return $typeList; }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $types = Type::all(); $marques = Marque::all(); $modeles = Modele::all(); $couleurs = Couleur::all(); $vehicule = Vehicule::find($id); $idMarque = DB::table('modele')->join('marque', 'marque.marque_id', '=', 'modele.marque_id')->select('marque.marque_id')->where('modele.modele_id', $vehicule->modele_id)->get()[0]->marque_id; $idType = DB::table('marque')->join('type', 'type.type_id', '=', 'marque.type_id')->select('type.type_id')->where('marque.marque_id', $idMarque)->get()[0]->type_id; return view('dashboard.profile.vehicule.edit_car', ['types' => $types, 'marques' => $marques, 'marqueCourante' => $idMarque, 'modeles' => $modeles, 'typeCourant' => $idType, 'couleurs' => $couleurs, 'vehicule' => $vehicule]); }