Ejemplo n.º 1
0
 public function run()
 {
     ModelRef::truncate();
     MarkRef::truncate();
     DB::table('mark_ref_vehicle_type_ref')->truncate();
     $cars = ["AC Cars" => ["Ace", "Aceca", "Cobra"], "Acura" => ["CL", "CSX", "EL", "ILX", "Integra", "MDX", "NSX", "RDX", "RL", "RLX", "RSX", "TL", "TLX", "TSX", "ZDX"], "Alfa Romeo" => ["145", "146", "147", "156", "159", "166", "4C", "8C", "Brera", "Giulietta ", "GT", "GTV", "MiTo", "Spider"], "Asia" => ["Retona", "Rocsta"], "Aston Martin" => ["Cygnet", "DB7", "DB9", "DBS", "ONE-77", "Rapide", "Vantage", "Vanquish", "Zagato", "Virage"], "Audi" => ["100", "A1", "A2", "A3", "A4", "A4 Allroad", "A5", "A6", "A6 Allroad", "A7", "A8", "Q3", "Q5", "Q7", "R8", "RS Q3", "RS3", "RS4", "RS5", "RS6", "RS7", "S3", "S4", "S5", "S6", "S7", "S8", "SQ5", "TT", "TTS"], "AzSamand" => ["Aziz", "LX"], "BAIC" => ["A115", "A315", "A5", "K4", "R315", "X424", "XB4", "XB624", "XB628"], "Bentley" => ["Arnage", "Azure", "Brooklands", "Continental Flying Spur", "Continental GT", "Flying Spur", "Mulsanne"], "BMW" => ["1-series", "2-series", "3-series", "4-series", "5-series", "6-series", "7-series", "i3", "i8", "M3", "M4", "M5", "M6", "X1", "X3", "X4", "X5", "X5 M", "X6", "X6 M", "Z3", "Z4", "Z8"], "BMW Alpina" => ["B3", "B4", "B5", "B6", "B7", "B10", "B12", "D3", "D5", "D10", "RLE", "Roadster S", "Roadster V8", "XD3"], "Brilliance" => ["BS2", "BS4", "BS6", "M1", "M2", "M3", "H 230", "H 320", "H 530", "V5"], "Bronto" => ["Rıs"], "Bugatti" => ["EB 16.4 Veyron"], "Buick" => ["Enclave", "Excelle", "GL8", "LaCrosse", "Le Sabre", "Lucerne", "Park Avenue", "Rainier", "Regal", "Rendezvous", "Riviera", "Terraza"], "BYD" => ["E6", "F0", "F3", "F3R", "F5", "F6", "F7", "Flyer", "G3", "G6", "i6", "L3", "M6", "S6"], "Cadillac" => ["ATS", "BLS", "Catera", "CTS", "De Ville", "DTS", "Eldorado", "ELR", "Escalade", "Seville", "SRX", "STS", "XLR", "XTS"], "Changan/Chana" => ["Alsvin", "Benni Mini", "CM8", "CS35", "CX20", "CX30", "Eado", "Honor", "Love"], "ChangFeng" => ["Flying"], "Chery" => ["A1 (Kimo)", "A13 (Bonus)", "A15 (Amulet)", "A18 (Karry)", "A21 (Fora)", "A3 (M11)", "A5", "B11 (Oriental Son)", "B14 (CrossEastar)", "Cowin", "E5", "Eastar", "Fulwin2", "IndiS (S18D)", "QQ (Sweet)", "QQ6 ", "Tiggo", "Very"], "Chevrolet" => ["Alero", "Astra", "Astro", "Avalanche", "Aveo", "Beretta", "Blazer", "Blazer K5", "Camaro", "Caprice", "Captiva ", "Cavalier", "Celta", "Classic", "Cobalt", "Colorado", "Corsa", "Corsica", "Corvette", "Cruze", "Epica", "Equinox", "Evanda", "Express", "HHR", "Impala", "Kalos", "Lacetti", "Lanos", "Lumina", "Lumina APV", "LUV D-MAX", "Malibu", "Metro", "Monte Carlo", "MW", "Niva", "Nubira", "Omega", "Orlando", "Prizm", "Rezzo", "S-10", "Sail", "Silverado", "Sonic", "Spark (Matiz)", "SSR", "Suburban", "Tacuma", "Tahoe", "Tavera", "Tracker", "TrailBlazer", "Trans Sport", "Traverse", "Uplander", "Vectra", "Venture", "Viva", "Volt", "Zafira"], "Chrysler" => ["200", "300C", "300M", "Aspen", "Cirrus", "Concorde", "Crossfire", "Delta", "Grand Voyager", "Intrepid", "Le Baron", "LHS", "Nassau", "Neon", "New Yorker", "PT Cruiser", "Pacifica", "Saratoga", "Sebring", "Stratus", "Town & Country", "Vision", "Voyager"], "Citroen" => ["Berlingo", "BX", "C-Crosser", "C-Elysee", "C1", "C2", "C3", "C3 Picasso", "C4", "C4 Aircross", "C4 L", "C4 Picasso", "C5", "C6", "C8", "DS3", "DS4", "DS5", "Evasion", "Jumper", "Jumpy", "Nemo", "Saxo", "Xantia", "XM", "Xsara", "Xsara Picasso", "ZX"], "Dacia" => ["Dokker", "Duster ", "Lodgy", "Logan", "Sandero"], "Dadi" => ["City Leading", "Shuttle"], "Daewoo" => ["Cielo", "Damas", "Espero", "Gentra", "Kalos", "Korando", "Lacetti", "Lanos (Sens)", "Leganza", "Magnus", "Matiz", "Musso", "Nexia", "Nubira", "Prince", "Racer", "Rezzo", "Super Salon", "Tacuma", "Tico", "Winstorm"], "Daihatsu" => ["Applause", "Atrai", "Be-go", "Boon", "Boon Luminas", "Charade", "Coo", "Copen", "Cuore", "Delta Wagon", "Esse", "Feroza", "Gran Move", "Hijet", "Materia", "Mira", "Move", "Naked", "Pyzar", "Sirion", "Sonica", "Storia", "Tanto", "Terios", "YRV"], "Daimler" => ["X350"], "Datsun" => ["on-DO"], "Derways" => ["Aurora ", "Cowboy", "Plutus", "Shuttle"], "Dodge" => ["Avenger", "Caliber", "Caravan", "Challenger", "Charger", "Dakota", "Dart", "Durango", "Grand Caravan", "Intrepid", "Journey", "Magnum", "Neon", "Nitro", "Ram", "Stratus", "Viper"], "DongFeng" => ["H30 Cross", "Rich"], "FAW" => ["Besturn B50", "Besturn B70", "Besturn B90", "Besturn X80", "HongQi H7 (C131)", "HongQi HQ3", "Jiaxing", "Jinn", "Oley", "Sirius S80", "V2", "V5", "Vela", "Vita", "Vita C1", "Xiali N3", "Xiali N5", "Xiali N7"], "Ferrari" => ["360 ", "456M ", "458 ", "550", "575M", "599 ", "612 Scaglietti", "California", "F12berlinetta", "F430", "FF", "LaFerrari"], "Fiat" => ["1100", "500", "Albea", "Barchetta", "Brava", "Bravo", "Cinquecento (500L)", "Coupe", "Croma", "Doblo", "Fiorino ", "Freemont", "Idea", "Linea", "Marea", "Multipla", "Palio", "Panda", "Panorama", "Punto", "Qubo", "Scudo", "Sedici", "Seicento", "Siena", "Stilo", "Tempra", "Tipo", "Ulysse", "Uno"], "Ford" => ["Aerostar", "B-Max", "Bronco", "C-Max", "Contour", "Cougar", "Courier", "Crown Victoria", "Ecosport", "Edge", "Escape", "Escort", "Excursion", "Expedition", "Explorer", "F-150", "F-250", "F-350", "F-450 (Super Duty)", "Festiva", "Fiesta", "Five Hundred", "Flex", "Focus", "Freestyle", "Fusion", "Galaxy", "Granada", "Grand C-Max", "Ka", "Kuga", "Laser", "Maverick", "Mercury", "Mondeo", "Mustang", "Probe", "Puma", "Ranchero", "Ranger", "S-Max", "Scorpio", "Sierra", "Sport Track", "Streetka", "Taunus", "Taurus", "Tempo", "Thunderbird", "Tourneo Connect", "Tourneo Custom", "Windstar"], "Foton" => ["Midi", "SUP C1", "SUP C2", "SUP C3", "SUP CX", "Tunland", "View M"], "GAZ" => ["13", "14", "21", "22", "24", "2410", "3102", "31029", "3105", "3110", "31105", "3111", "M-20 Pobeda", "M-21", "M-22", "Next", "Siber", "Sobol"], "Geely" => ["CK (Otaka)", "Emgrand 7 (EC7)", "Emgrand 7 RV (EC7 RV)", "Emgrand 8 (EC8)", "Emgrand X7 (EX7)", "FC (Vision)", "GC2", "GC5", "GC6", "GC7", "MK", "MK Cross"], "GMC" => ["Acadia", "Canyon", "Envoy", "Jimmy", "Sierra", "Suburban", "Terrain", "Yukon"], "Gonow" => ["AOOSED G5", "AOOSED GX5", "Jetstar", "Starry", "Troy", "Way"], "Great Wall" => ["C20R", "C30", "C50", "Coolbear", "Deer", "Florid", "H3", "H5", "H6", "M2", "M4", "Pegasus", "Peri", "Safe", "Sailor", "Socool", "Sing", "Voleex C10", "Voleex C20R", "Voleex C30", "Voleex C50", "Voleex V80", "Wingle 5", "X240"], "Hafei" => ["Brio ", "Lobo", "Princip", "Saibao", "Saima", "Sigma", "Simbo"], "Haima" => ["2", "3", "7", "Freema", "Fstar", "M3", "S7"], "Honda" => ["Accord", "Airwave", "Ascot", "Ascot Innova", "Avancier", "Capa", "City", "Civic", "Civic Ferio", "Concerto", "CR-V", "CR-X", "CR-Z", "Crossroad", "Crosstour", "Domani", "Edix", "Element", "Elysion", "Fit ", "Fit Aria", "Fit Shuttle", "FR-V", "Freed", "HR-V", "Insight", "Inspire", "Integra", "Integra SJ", "Jazz", "Legend", "Life", "Logo", "MDX", "Mobilio", "Mobilio Spike", "Odyssey", "Orthia", "Partner", "Passport", "Pilot (MR-V)", "Prelude", "Rafaga", "Ridgeline", "S-MX", "S 2000", "Saber", "Shuttle", "Stepwgn", "Stream", "Torneo", "Vamos", "Vigor", "Z", "Zest"], "Hummer" => ["H1", "H2", "H3"], "Hyundai" => ["Accent", "Atos (Amica)", "Avante", "Centennial", "Coupe ", "Elantra", "Equus", "Excel", "Galloper", "Genesis", "Getz", "Grandeur (Azera)", "H-1 (Starex)", "HB20", "i10", "i20", "i30", "i40", "ix20", "ix35", "ix55", "Lantra", "Lavita", "Matrix", "Maxcruz", "S-Coupe", "Santa Fe", "Santamo", "Solaris", "Sonata", "Terracan", "Tiburon", "Trajet", "Tucson", "Tuscani", "Veloster", "Veracruz", "Verna", "XG", "XG"], "IJ" => ["2125 (Kombi)", "2126 (Oda)", "21261 (Fabula)", "2717", "2717-022", "27175", "49"], "Infiniti" => ["EX-series", "FX-series", "G-series", "I-series", "JX-series", "M-series", "Q45", "Q50", "Q60", "Q70", "QX4", "QX50", "QX56", "QX60", "QX70", "QX80"], "Iran Khodro" => ["Bardo", "Dena", "Runna", "Samand", "Sarir", "Soren"], "Isuzu" => ["Aska", "Axiom", "Bighorn", "D-Max", "Rodeo", "Trooper", "VehiCross", "Wizard"], "JAC" => ["J2 (Yueyue)", "J3 (Tongyue)", "J5 (Heyue)", "J6 (Heyue RS)", "J7 (Binyue)", "M1", "M5", "JAC Pickup", "S1 (Rein)", "S5 (Eagle)"], "Jaguar " => ["F-Type", "S-Type", "X-Type", "XE", "XF", "XJ", "XK"], "Jeep" => ["Cherokee", "Commander", "Compass", "Grand Cherokee", "Liberty (Patriot)", "Rengade", "Wrangler"], "Jinbei" => ["Careza", "FSV", "Granse"], "Kia" => ["Avella", "Cadenza", "Capital", "Carens ", "Carnival", "Cee’d", "Cerato", "Clarus", "Forte", "Joice", "Lotze", "Magentis ", "Mohave", "Opirus", "Optima", "Picanto", "Pride", "Quoris", "Ray", "Retona", "Rio", "Sedona", "Sephia", "Shuma", "Sorento", "Soul", "Spectra", "Sportage", "Venga"], "Lamborghini" => ["Aventador ", "Diablo", "Gallardo ", "Huracan", "Murcielago", "Reventon"], "Lancia" => ["Dedra", "Delta", "Kappa", "Lybra", "Musa", "Phedra", "Thema", "Thesis", "Voyager", "Ypsilon", "Zeta"], "Land Rover" => ["Defender", "Discovery", "Freelander", "Range Rover", "Range Rover Evoque", "Range Rover Sport"], "Lexus" => ["CT-series", "ES-series", "GS-series", "GX-series", "HS-series", "IS-series", "LS-series", "LX-series", "RX-series", "SC-series"], "Lifan" => ["Breez (520)", "Cebrium (720)", "Celliya (530)", "Smily (320)", "Solano (620)", "X60"], "Lincoln" => ["Aviator", "Continental", "LS", "Mark LT", "MKS", "MKT", "MKX", "MKZ", "Navigator", "Towncar"], "Lotus" => ["Elise", "Exige", "Evora"], "LuAZ" => ["969"], "Luxgen" => ["5", "7", "U6"], "Mahindra " => ["Marshal", "MM"], "Maserati" => ["3200 GT", "4200 GT", "Ghibli", "GranCabrio", "GranSport", "GranTurismo", "MC12", "Quattroporte", "Spyder"], "Maybach" => ["57 ", "57 Zeppelin", "62", "62 Zeppelin", "62 Landaulet", "Guard"], "Mazda" => ["121", "2", "3", "323", "5", "6", "626", "929", "Atenza", "Axela", "AZ-Wagon", "B-series", "Biante", "Bongo", "Bongo Friendee", "BT-50", "Capella", "Carol", "CX-5", "CX-7", "CX-9", "Demio", "Familia", "Levante", "Millenia", "MPV", "MX-3", "MX-5", "MX-6", "Premacy", "Proceed", "Protege", "RX 7", "RX 8", "Scrum Wagon", "Tribute", "Verisa", "Xedos 6", "Xedos 9"], "McLaren" => ["MP4-12C"], "Mercedes" => ["190", "A-class", "B-class", "C-class", "CL-class", "CLA-class", "CLC-class", "CLK-class", "CLS-class", "E-class", "G-class", "GL-class", "GLA-class", "GLK-class", "M-class", "R-class", "S-class", "SL-class", "SLK-class", "SLR McLaren", "SLS AMG-class", "V-class", "Vaneo", "Viano", "Vito"], "Mercury" => ["Cougar", "Grand Marquis", "Marauder", "Mariner", "Marquis", "Milan", "Mountaineer", "Montego", "Mystique", "Sable", "Topaz", "Villager"], "MG" => ["3", "350", "5", "550", "6", "750", "F", "RV8", "TF", "X-Power", "ZR", "ZS", "ZT"], "Mini" => ["Cabrio", "Clubman", "Clubvan", "Countryman", "Coupe", "Hardtop", "Paceman", "Roadster"], "Mitsubishi" => ["3000 GT", "Airtrek", "Aspire", "ASX", "Carisma", "Cedia", "Challenger", "Chariot", "Colt", "Delica", "Diamante", "Dingo", "Dion", "Eclipse", "eK", "Endeavor", "Eterna", "FTO", "Fuzion (Zinger)", "Galant", "Grandis", "GTO", "i", "i-MiEV", "L 200", "L 300", "L400", "Lancer", "Lancer Cargo", "Lancer Evolution", "Legnum", "Libero", "Magna", "Minica", "Mirage", "Montero", "Montero iO", "Montero Sport ", "Outlander", "Pajero", "Pajero iO", "Pajero Junior", "Pajero Mini", "Pajero Pinin", "Pajero Sport", "Raider", "RVR", "Sigma", "Space Gear", "Space Runner", "Space Star", "Space Wagon", "Strada", "Toppo", "Town Box"], "Moskvich" => ["2136", "2137", "2140", "2141", "2715", "401", "402", "403", "407", "408", "410", "412", "423", "426", "Duet", "Knyaz Vladamir", "Svyatoqor"], "Nissan" => ["100NX", "180SX", "200SX", "240SX", "300ZX", "350Z", "370Z", "AD", "Almera", "Almera Classic", "Almera Tino", "Altima", "Armada", "Avenir", "Bassara", "Bluebird", "Bluebird Sylphy", "Caravan", "Cedric", "Sefiro", "Cima", "Clipper", "Cube", "Datsun", "Dualis", "Elgrand", "Expert", "Fairlady Z", "Fuga", "Gloria", "GT-R", "Juke", "Kix", "Lafesta", "Langley", "Largo", "Latio", "Laurel", "Leaf", "Leopard", "Liberty", "Lucino", "March", "Maxima", "Micra", "Mistral", "Moco", "Murano", "Navara (Frontier)", "Note", "NP300", "NV200", "Otti", "Pathfinder", "Patrol", "Pino", "Pixo", "Prairie", "Presage", "Presea", "President", "Primera", "Pulsar", "Qashqai", "Qashqai +2", "Quest", "Rasheen", "R`nessa", "Rogue", "Roox", "Safari", "Sentra", "Serena", "Silvia", "Skyline", "Stagea", "Sunny", "Teana", "Terrano", "Terrano Regulus", "Tiida", "Tino", "Titan", "Vanette", "Versa", "Wingroad", "X-Trail", "X-Terra"], "Opel" => ["Adam", "Agila", "Ampera", "Antara", "Astra", "Calais", "Calibra", "Campo", "Cascada", "Combo", "Corsa", "Frontera", "GT", "Insignia", "Kadett", "Meriva", "Mokka", "Monterey", "Omega", "Signum", "Sintra", "Speedster", "Tigra", "Vectra", "Vita", "Vivaro", "Zafira"], "Peugeot" => ["1007", "106", "107", "2008", "205", "206", "207", "208", "3008", "301", "306", "307", "308", "4007", "4008", "405", "406", "407", "408", "5008", "508", "605", "607", "806", "807", "Bipper", "Expert", "ION", "Pars", "Partner", "RCZ"], "Plymouth" => ["Acclaim", "Breeze", "Laser", "Neon", "Sundance", "Voyager"], "Pontiac" => ["Aztek", "Bonneville", "Firebird", "G6", "Grand Am", "Grand Prix", "GTO", "Montana", "Solstice", "Sunfire", "Trans Sport", "Vibe"], "Porsche" => ["911", "928", "968", "Boxster", "Carrera GT", "Cayenne", "Cayman", "Macan", "Panamera"], "Proton" => ["Exora", "Gen-2 ", "Inspira", "Juara", "Persona", "Perdana", "Preve", "Saga", "Satria", "Suprima S", "Waja", "Wira"], "Renault" => ["11", "12", "19", "21", "25", "Avantime", "Clio", "Duster", "Espace", "Fluence", "Kangoo", "Koleos", "Laguna", "Latitude", "Logan", "Megane", "Modus", "Safrane", "Sandero", "Scenic", "Symbol", "Trafic", "Twingo", "Vel Satis", "Wind", "Zoe"], "Roewe" => ["350", "550", "750", "950", "E50", "MG3", "MG5", "MG6", "MG7", "MGTF", "W5"], "Rolls-Royce" => ["Corniche", "Flying Spur", "Ghost", "Park Ward", "Phantom", "Silver Seraph", "Silver Spur", "Wraith"], "Rover" => ["100", "200", "25", "400", "416", "45", "600", "75", "800", "CityRover", "Metro", "Mini", "Streetwise"], "Saab" => ["9-2X", "9-3", "9-4X", "9-5", "9-7X", "900", "9000"], "Saipa" => ["111", "132", "141", "Saba", "Tiba"], "Saturn" => ["L-series", "S-series", "Aura", "Astra", "ION", "Outlook", "Relay", "SC", "SKY", "VUE"], "Scion" => ["tC ", "xA ", "xB"], "SEAT" => ["Alhambra", "Altea", "Arosa", "Cordoba", "Exeo", "Ibiza", "Inca", "Leon", "Toledo"], "SeAZ" => ["Oka"], "Shineray" => ["A7"], "Shuang Huan" => ["Noble", "SCEO"], "Skoda" => ["Citigo", "Fabia", "Felicia", "Octavia", "Praktik", "Rapid", "Roomster", "Superb", "Yeti"], "Smart" => ["City", "Forfour", "Fortwo", "Roadster"], "Ssang Yong" => ["Actyon", "Actyon Sports", "Chairman", "Korando", "Kyron", "Musso", "Rexton", "Rodius", "Stavic"], "Subaru" => ["Baja", "BRZ", "Exiga", "Forester", "Impreza", "Justy", "Legacy", "Outback", "Pleo", "R1", "R2", "Stella", "Trezia", "Tribeca", "Vivio", "XV"], "Suzuki" => ["Aerio", "Alto", "Baleno (Esteem)", "Celerio", "Cervo", "Cultus", "Cultus Crescent", "Ertiga", "Escudo", "Every", "Forenza", "Grand Vitara", "Ignis", "Jimny", "Kei", "Kizashi", "Landy", "Liana", "MR Wagon", "Palette", "Reno", "Samurai", "Sidekick", "Solio", "Spacia", "Splash", "Swift", "SX4", "Verona", "Vitara", "Wagon R", "Wagon R+", "X-90", "XL7"], "TaqAZ" => ["Aquila", "C10", "C190", "Road Partner", "Tager", "Vega"], "Tesla" => ["Model S"], "Tianma" => ["Century"], "Tianye" => ["Admiral"], "Tofas" => ["Dogan", "Kartal", "Sahin"], "Toyota" => ["4-Runner", "Allex", "Allion", "Alphard", "Altezza", "Aristo", "Aurion", "Auris", "Avalon", "Avanza", "Avensis", "Avensis Verso", "Aygo", "bB", "Belta", "Blade", "Brevis", "Caldina", "Cami", "Camry", "Camry Solara", "Carina", "Carina ED", "Cavalier", "Celica", "Celsior", "Chaser", "Corolla", "Corolla Axio", "Corolla Ceres", "Corolla Levin", "Corolla Rumion", "Corolla Verso (Spacio)", "Corona", "Corsa", "Cressida", "Cresta", "Crown", "Crown Majesta", "Curren", "Cynos", "Duet", "Echo", "Estima", "EXiV", "FJ Cruiser", "Fortuner", "Funcargo", "Gaia", "Granvia", "GT 86", "Harrier", "Hiace", "Highlander", "Hilux", "Hilux Surf", "Innova", "Ipsum", "iQ", "ISis", "Ist", "Kluger", "Land Cruiser", "Land Cruiser Prado", "LiteAce", "Mark II", "Mark X", "Mark X ZiO", "Matrix", "Mega Cruiser", "MR2", "MR-S", "Nadia", "Noah", "Opa", "Paceo", "Passo", "Passo Sette", "Picnic", "Platz", "Porte", "Premio", "Previa", "Prius", "Prius C (Aqua)", "Prius V", "Probox", "Progres", "Pronard", "Ractis", "Raum", "RAV 4", "Regius", "RegiusAce", "Rush", "Sai", "Scepter", "Sequoia", "Sera", "Sienna", "Sienta", "Soarer", "Soluna", "Sparky", "Sprinter", "Sprinter Carib", "Sprinter Marino", "Sprinter Trueno", "Starlet", "Succeed", "Supra", "Tacoma", "Tercel", "TownAce", "Tundra", "Urban Cruiser", "Vanguard", "Vellfire", "Venza", "Verossa", "Verso", "Verso-S", "Vios", "Vista", "Vitz", "Voltz", "Voxy", "WiLL Cypha (Will VC)", "Will Vi", "Will VS", "Windom", "Wish", "Yaris", "Yaris Verso", "Zelas"], "UAZ" => ["2206", "23602 Cargo", "3151", "3153", "3159 Bars", "3160", "3162 Simbir", "3303", "3741", "3909", "452", "469", "Patriot", "Hunter", "Pickup"], "VAZ" => ["1111 Oka", "2101", "2102", "2103", "2104", "2105", "2106", "2107", "2108", "2109", "21099", "2110", "2111", "2112", "21123", "2113", "2114", "2115", "2120 Nadejda", "2121", "2123", "2129", "2131", "2328", "2329", "Granta", "Kalina", "Largus", "Niva", "Priora", "Tarzan"], "Volkswagen" => ["Amarok", "Beetle", "Bora", "Caddy", "California", "Caravelle", "Citi Golf", "Corrado", "Eos", "Fox", "Gol", "Golf", "Golf Plus", "Golf Sportsvan", "Jetta", "Lupo", "Multivan", "New Beetle", "Parati", "Passat", "Passat CC", "Phaeton", "Pointer", "Polo", "Routan", "Saveiro", "Scirocco", "Sharan", "Suran", "Tiguan", "Touareg", "Touran", "Transporter", "Up", "Vento", "XL1"], "Volvo" => ["440", "460", "740", "760", "780", "850", "940", "960", "C 30", "C 70", "S 40", "S 60", "S 70", "S 80", "S 90", "V 40", "V 50", "V 60", "V 70", "V 90", "XC 60 ", "XC 70", "XC 90"], "Vortex" => ["Corda ", "Estina ", "Tingo"], "Xin Kai" => ["SR-V X3", "SUV X3", "Pickup X3"], "ZAZ" => ["965", "966", "968", "1103 Slavuta", "1102 Tavriya", "1105 Dana", "Chance", "Forza", "Lanos", "Sens", "Vida"], "ZX" => ["Admiral", "Grand Tiger", "Landmark"]];
     $motos = ['ABM', 'ACCESS', 'ADLY', 'AEON', 'AIE MOTOR', 'APOLLO', 'APRILIA', 'ARCTIC CAT', 'ARLEN NESS', 'ARMADA', 'ARORA', 'ASA', 'ATLANT', 'AVANTIS', 'AVM', 'AYRON', 'BALTMOTORS', 'BAOTIAN SCOOTERS', 'BARS', 'BASHAN', 'BENELLI', 'BETA', 'BIG BEAR CHOPPERS', 'BIG DOG MOTORCYCLES', 'BIMOTA', 'BISON', 'BLADE', 'BM', 'BMW', 'BOOM TRIKES', 'BOSS HOSS', 'BRP', 'BSE', 'BUGFASTER', 'BUGGY JUMP', 'BUELL', 'BULL', 'CAGIVA', 'CAMPAGNA', 'CAN-AM', 'CECTEK', 'CELIMO', 'CENTURION', 'CFMOTO', 'COBRA', 'CONFEDERATE', 'CORSA', 'CPI', 'CRONUS', 'CRZ', 'CZ', 'DAELIM', 'DANDY', 'DAYUN', 'DERBI', 'DESERT RAVEN', 'DESNA', 'DIRTMAX', 'DKW', 'DNEPR', 'DUCATI', 'ELIT', 'E-MOTO', 'EUROTEX', 'EXCELSIOR-HENDERSON', 'FALCON', 'FEISHEN', 'FIGHTER', 'FINE CUSTOM MECHANICS', 'FORSAGE', 'FORTUNE', 'FUN CRUISER', 'GABRO', 'GAMAX', 'GAS GAS', 'GEELY', 'GENATA', 'GEON', 'GERDAKAR', 'GIBBS', 'GILERA', 'GODZILLA', 'GRYPHON', 'GUOWEI', 'GX MOTO', 'HAOBON', 'HAOJUE', 'HARLEY-DAVIDSON', 'HIGHLAND', 'HISUN', 'HONDA', 'HONLING', 'HORS', 'HUATIAN', 'HUSABERG', 'HUSQVARNA', 'HYOSUNG', 'IJ', 'INDIAN', 'IRBIS', 'IRON EAGLE', 'IRON HORSE', 'ITALJET', 'JANUS', 'JAWA', 'JAWA-CZ', 'JIALING', 'JIANSHE-YAMAHA', 'JINLING', 'JMC', 'JOHNNY PAG', 'JOINER', 'JONWAY', 'JORDAN MOTOR', 'KARPATY', 'KAWASAKI', 'KAXA MOTOS', 'KAYO', 'KAZUMA', 'KEEWAY', 'KHALEX', 'KINLON', 'KINROAD', 'KREIDLER', 'KTM', 'KUBOTA', 'KXD', 'KYMCO', 'LEBEDEV GARAGE', 'LEIKE', 'LIFAN', 'LINGBEN', 'LINHAI-YAMAHA', 'LML', 'LOKKER', 'LONCIN', 'MALAGUTI', 'MASAI', 'MEGELLI', 'MIKE-MOTORS', 'MIKILON', 'MINSK', 'MMZ', 'MOTO GUZZI', 'MOTO MORINI', 'MOTOLAND', 'MV AGUSTA', 'NBLUCK', 'NEXUS', 'NISSAMARAN', 'NITRO', 'OMAKS MOTORS', 'ORANGE COUNTY CHOPPERS', 'ORION', 'OXOBIKE', 'PAGSTA', 'PANNONIA', 'PATRON', 'PCW', 'PEUGEOT', 'PGO', 'PIAGGIO', 'PITMOTO', 'PITRACE', 'PITSTERPRO', 'POCKET BIKE', 'POLAR FOX', 'POLARIS', 'POLINI', 'PONY MOTORS', 'PSKOVSKAYA MEXANIKA', 'PUCH', 'QINGQI', 'QUADRO', 'QUADRAIDER', 'RACER', 'RAPIRA', 'REGAL RAPTOR', 'REGGY', 'RENLI', 'REWACO', 'RIEJU', 'RİGA', 'ROKON', 'ROYAL ENFIELD', 'RUSSKAYA MEXANIKA', 'SACHS BIKES', 'SAGITTA', 'SAXON', 'SCARABEO', 'SENKE', 'SHERCO', 'SHINERAY', 'SIMBEL', 'SIMSON', 'SKYGO', 'SONIK', 'STELS', 'STINGRAY', 'STROM', 'SUZUKI', 'SYM', 'TITAN', 'TM', 'TMZ', 'TOMOS', 'TORNADO', 'TRIUMPH', 'TULA', 'TVS', 'UMC', 'URAL', 'VELOCI', 'VENTA', 'VENTO', 'VERXOVINA', 'VESPA', 'VICTORY', 'VIPER', 'VON DUTCH', 'VOSXOD', 'VYATKA', 'WELS', 'WYP-MOTOR', 'XMOTOS', 'YAMAHA', 'YAMASAKI', 'YCF', 'YIBEN', 'YINXIANG', 'ZID', 'ZIM', 'ZONGSHEN', 'ZONTES'];
     $trucks = ['AMUR', 'ASTRA', 'AVIA', 'BAW', 'BEIFAN', 'BELAZ', 'CAMC', 'CHANGAN', 'CHEVROLET', 'CITROEN', 'DAEWOO', 'DAF', 'DONGFENG', 'ERF', 'FAW', 'FIAT', 'FORD', 'FOTON', 'FREIGHTLINER', 'GAZ', 'GAZ-SAZ', 'GINAF', 'GMC', 'GRAZ', 'HANIA', 'HINO', 'HOKA', 'HONDA', 'HOWO', 'HYUNDAI', 'IFA', 'INTERNATIONAL', 'ISUZU', 'IVECO', 'IVECO HONGYAN', 'IVECO-LING YE', 'IVECO-URAL', 'JAC', 'JMC', 'KAMAZ', 'KENWORTH', 'KIA', 'KRAZ', 'LDV', 'MACK', 'MAGIRUS DEUTZ', 'MAN', 'MAZ', 'MAZDA', 'MAZ-MAN', 'MERCEDES-BENZ', 'MITSUBISHI', 'MZKT', 'NAVECO', 'NEFAZ', 'NISSAN', 'NORTH BENZ', 'OPEL', 'PETERBILT', 'PEUGEOT', 'RENAULT', 'ROBUR', 'RUSICH', 'SCANIA', 'SHAANXI', 'SHAANXI-MAN', 'SHACMAN', 'SINOTRUCK', 'SISU', 'SKODA LIAZ', 'SSANG YONG', 'STERLING', 'SUZUKI', 'TAGAZ', 'TATA', 'TATA DAEWOO', 'TATRA', 'TERBERG', 'TIEMA', 'TITAN', 'TONAR', 'TOYOTA', 'UAZ', 'URAL', 'VOLKSWAGEN', 'VOLVO', 'YAROVIT', 'YUEJIN', 'ZIL'];
     $buses = ['ASIA', 'BAW', 'BAZ', 'BOQDAN', 'BOVA', 'DAEWOO', 'DAF', 'DALI', 'DONGFENG', 'FORD', 'GAZ', 'GOLAZ', 'GOLDEN DRAGON', 'HIGER', 'HYUNDAI', 'IKARBUS', 'IKARUS', 'ISUZU', 'IVECO', 'JAC', 'KAMAZ', 'KAROSA', 'KAVZ', 'KIA', 'KING LONG', 'LAZ', 'LIAZ', 'MAN', 'MARCOPOLO', 'MARZ', 'MAZ', 'MERCEDES-BENZ', 'MUDAN', 'NEFAZ', 'NEMAN', 'NEOPLAN', 'PAZ', 'ROAZ', 'ROUTEMASTER', 'SCANIA', 'SETRA', 'SHEN LONG', 'SHAOLIN', 'SHUCHI', 'SSANG YONG', 'TAM', 'TEMSA', 'TOYOTA', 'URAL', 'VAN HOOL', 'VOLJANIN', 'VOLKSWAGEN', 'VOLVO', 'YUTONG', 'ZHONG TONG', 'ZIL', 'ZONDA'];
     foreach ($cars as $mark => $models) {
         $mark = MarkRef::create(['name' => $mark]);
         $mark->vehicleTypes()->attach(2);
         array_map(function ($model) use($mark) {
             $model = ModelRef::create(['name' => $model, 'mark_id' => $mark->id, 'vehicle_type_id' => 2]);
             $carBodyTypeIndex = rand(21, 37);
             $carBodyType = BodyTypeRef::find($carBodyTypeIndex);
             $carBodyType->models()->attach($model->id);
         }, $models);
     }
     array_walk($motos, function ($moto) {
         $mark = MarkRef::create(['name' => $moto]);
         $mark->vehicleTypes()->attach(3);
     });
     array_walk($trucks, function ($truck) {
         $mark = MarkRef::create(['name' => $truck]);
         $mark->vehicleTypes()->attach(1);
     });
     array_walk($buses, function ($bus) {
         $mark = MarkRef::create(['name' => $bus]);
         $mark->vehicleTypes()->attach(4);
     });
 }
Ejemplo n.º 2
0
 /**
  * Display a listing of the resource.
  * GET /admin/users
  *
  * @return Response
  */
 public function index()
 {
     $users = User::withTrashed();
     foreach (Input::all() as $key => $input) {
         if (in_array($key, ['vehicle_type', 'mark', 'model', 'body_type'])) {
             $users->whereHas('cars', function ($q) use($key, $input) {
                 $q->where($key, $input);
             });
         } elseif ($key == 'city') {
             $users->where($key, $input);
         }
     }
     $users = $users->with('cityRef')->paginate();
     return View::make('admin.users.index', ['title' => 'Пользователи', 'columns' => ['ID', 'Аватар', 'Имя', 'Почта', 'Номер телефона', 'Город', 'Возраст', 'Сообщений', 'Удален в', '', ''], 'data' => $users->transform(function ($user) {
         return ['id' => $user->id, 'img' => "<img src='{$user->img_small}'>", 'name' => link_to_action('AdminUsersController@show', $user->name, [$user->id]), 'email' => $user->email, 'phone' => $this->returnIfPresent($user, 'phone', 'number'), 'city' => $this->returnIfPresent($user, 'cityRef', 'ru'), 'age' => $user->birthday, 'messages' => $user->messages()->count(), 'deleted' => $user->deleted_at, 'edit' => link_to_action('AdminUsersController@edit', 'ред', [$user->id]), 'delete' => link_to_action('AdminUsersController@edit', 'удал', [$user->id])];
     }), 'links' => $users->links(), 'actions' => [link_to('#modal1', 'Разослать', ['class' => 'btn btn-primary btn-md margin']), link_to('#modal1', 'Опубликовать в ленту', ['class' => 'btn btn-primary btn-md margin']), link_to('#model1', 'Удалить выбранное', ['class' => 'btn btn-primary btn-md margin'])], 'filters' => [['param' => 'city', 'name' => 'Город', 'data' => CityRef::all()->transform(function ($city) {
         return ['id' => $city->id, 'name' => $city->ru];
     }), 'active' => Input::get('city')], ['param' => 'vehicle_type', 'name' => 'Тип Авто', 'data' => VehicleTypeRef::all()->transform(function ($v) {
         return ['id' => $v->id, 'name' => $v->ru];
     }), 'active' => Input::has('vehicle_type')], ['param' => 'mark', 'name' => 'Марка', 'data' => MarkRef::all()->transform(function ($m) {
         return ['id' => $m->id, 'name' => $m->name];
     }), 'active' => Input::has('mark')], ['param' => 'model', 'name' => 'Модель', 'data' => ModelRef::all()->transform(function ($m) {
         return ['id' => $m->id, 'name' => $m->name];
     }), 'active' => Input::Has('model')], ['param' => 'body_type', 'name' => 'Кузов', 'data' => BodyTypeRef::all()->transform(function ($b) {
         return ['id' => $b->id, 'name' => $b->ru];
     }), 'active' => Input::has('body_type')]]]);
 }
Ejemplo n.º 3
0
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         ModelRef::create([]);
     }
 }
Ejemplo n.º 4
0
 public function run()
 {
     $bodyTypes = [21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36];
     ModelRef::where('vehicle_type_id', 2)->chunk(100, function ($models) use($bodyTypes) {
         $models->each(function ($model) use($bodyTypes) {
             $model->bodyTypes()->attach($bodyTypes);
         });
     });
 }
Ejemplo n.º 5
0
 /**
  * Update the specified resource in storage.
  * PATCH /models/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $model = ModelRef::find($id);
     if (!model) {
         return $this->respondNoContent('Model not found');
     }
     if ($model->fill(Input::all())) {
         return $model;
     }
     return $this->respondServerError('Error updating model');
 }
Ejemplo n.º 6
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $locales = ['ru', 'az'];
     if ($this->option('with_categories')) {
         $this->info("Compile categories is on");
         MarkRef::with('models')->get()->each(function ($mark) {
             $this->line("Looking for {$mark->name}");
             $category = Generator::findOrCreate($mark->name);
             if ($category) {
                 Generator::findOrCreate("Все о {$mark->name}", '', $category->id);
                 $mark->models->each(function ($model) use($mark, $category) {
                     $this->line("Looking on {$model->name}");
                     Generator::findOrCreate($mark->name . ' ' . $model->name, 'Все что касается этой модели.', $category->id);
                 });
             }
         });
     }
     $configDate = Carbon::now()->toDateTimeString();
     $oldConfigDate = Config::get('database.refs-version');
     foreach ($locales as $locale) {
         $this->info('Compiling models');
         $tempDate = Carbon::now();
         $chunk = 200;
         $this->line("Batch {$chunk}");
         ModelRef::with('bodyTypes')->chunk($chunk, function ($models) use($oldConfigDate, $configDate, $locale) {
             Cache::forget("models-{$oldConfigDate}-{$locale}-part{$models->last()->id}");
             Cache::forever("models-{$configDate}-{$locale}-part{$models->last()->id}", $models->toArray());
             $this->line("End of chunk {$models->last()->id}");
         });
         Cache::forget("models-{$oldConfigDate}-{$locale}");
         Cache::forever("models-{$configDate}-{$locale}", ModelRef::all());
         $this->info("Finished compiling models. {$tempDate->diffInSeconds(Carbon::now(), true)} seconds");
         $this->info('Compiling marks');
         $tempDate = Carbon::now();
         Cache::forget("marks-{$oldConfigDate}-{$locale}");
         Cache::forever("marks-{$configDate}-{$locale}", MarkRef::with('vehicleTypes')->get()->toArray());
         $this->info("Finished compiling marks.{$tempDate->diffInSeconds(Carbon::now(), true)} seconds");
         $this->info('Compiling vehicle types');
         $tempDate = Carbon::now();
         Cache::forget("vehicle-types-{$oldConfigDate}-{$locale}");
         Cache::forever("vehicle-types-{$configDate}-{$locale}", VehicleTypeRef::all()->transform(function ($type) {
             return ['id' => $type->id, 'name' => $type->ru];
         })->toArray());
         $this->info("Finished compiling vehicle types. {$tempDate->diffInSeconds(Carbon::now(), true)} seconds");
         $this->line('Compiling cities');
         $tempDate = Carbon::now();
         Cache::forget("cities-{$oldConfigDate}-{$locale}");
         Cache::forever("cities-{$configDate}-{$locale}", CityRef::all()->transform(function ($city) use($locale) {
             return ['name' => $city->{$locale}, 'id' => $city->id];
         })->toArray());
         $this->info("Finished compiling cities. {$tempDate->diffInSeconds(Carbon::now(), true)} seconds");
         $this->info('Compiling body types');
         $tempDate = Carbon::now();
         Cache::forget("body-types-{$oldConfigDate}-{$locale}");
         Cache::forever("body-types-{$configDate}-{$locale}", BodyTypeRef::all()->transform(function ($type) use($locale) {
             return ['id' => $type->id, 'name' => $type->{$locale}];
         })->toArray());
         $this->info("Finishing compiling body types. {$tempDate->diffInSeconds(Carbon::now(), true)} seconds");
     }
     Cache::forever('database.refs-version', $configDate);
 }
Ejemplo n.º 7
0
 public function all()
 {
     $this->locale = in_array(Request::header('Locale'), $this->avaibleLocales) ? Request::header('Locale') : $this->avaibleLocales[0];
     $date = Input::has('date') ? Input::get('date') : null;
     if (is_null($date)) {
         $cities = CityRef::all();
         $vehicles = VehicleTypeRef::all();
         $bodyTypes = BodyTypeRef::all();
         $marks = MarkRef::all();
         $models = ModelRef::all();
     } else {
         $cities = CityRef::where('updated_at', '>=', $date)->get();
         $vehicles = VehicleTypeRef::where('updated_at', '>=', $date)->get();
         $marks = MarkRef::where('updated_at', '>=', $date)->get();
         $bodyTypes = BodyTypeRef::where('updated_at', '>=', $date)->get();
         $models = ModelRef::where('updated_at', '>=', $date)->get();
     }
     $response['vehicle-types'] = $this->transformVehicles($vehicles);
     $response['body-types'] = $this->transformBodyTypes($bodyTypes);
     $response['cities'] = $this->transformCities($cities);
     $response['models'] = $models;
     $response['marks'] = $marks;
     $response['date'] = Carbon::now()->toDateTimeString();
     return $this->respond($response);
 }
Ejemplo n.º 8
0
 /**
  * Store a new car
  * POST /api/users/self/cars
  *
  * @return Response
  */
 public function selfStore()
 {
     $user = Auth::user();
     //		if (!Input::has('number'))
     //			return $this->respondInsufficientPrivileges('Please select number');
     $validator = Car::validate(Input::all());
     if ($validator->fails()) {
         return $this->respondInsufficientPrivileges($validator->messages()->all());
     }
     $number = strtoupper(Input::get('number'));
     //		if ($number[2] == 'Z' && $number[3] == 'Z')
     //			return $this->respondInsufficientPrivileges('Wrong number. There is no ZZ');
     $region = substr($number, 0, 2);
     if (is_numeric($number[0]) && (int) Input::get('vehicle_type') != 3) {
         // smells a bit but whatever
         switch ((int) $region) {
             case $region == 0:
                 return $this->respondInsufficientPrivileges('Недопустимый код региона');
             case $region >= 73 && $region <= 84:
                 return $this->respondInsufficientPrivileges('Недопустимый код региона');
             case $region >= 86 && $region <= 89:
                 return $this->respondInsufficientPrivileges('Недопустимый код региона');
             case $region >= 91 && $region <= 98:
                 return $this->respondInsufficientPrivileges('Недопустимый код региона');
         }
     }
     if (is_numeric($number[0]) && strlen($number) > 6) {
         $zerosCount = 3;
         // amount of zeros
         // check if all numbers are zeros
         $zeros = array_diff(array_slice(str_split($number), 4), array_fill(0, $zerosCount, 0));
         if (empty($zeros)) {
             return $this->respondInsufficientPrivileges("Номер не может быть с {$zerosCount} нулями");
         }
     } elseif (strlen($number) > 6) {
         $zerosCount = 6;
         $zeros = array_diff(array_slice(str_split($number), 1), array_fill(0, $zerosCount, 0));
         if (empty($zeros)) {
             return $this->respondInsufficientPrivileges("Номер не может быть с {$zerosCount} нулями");
         }
     }
     // if seria in number are in AA, PA, РМ, YP. Which is not allowed.
     if (Car::checkSeria($number)) {
         return $this->respondInsufficientPrivileges('Номера с сериями АА, РА, РМ и YP добавляются в профиль пользователя службой поддержки только при подтверждении факта владения или пользования данной машиной. Обратитесь в техподдержку.');
     }
     $car = new Car(Input::all());
     $mark = MarkRef::find($car->mark);
     $model = ModelRef::find($car->model);
     $vehicleType = VehicleTypeRef::find($car->vehicle_type);
     $this->subscribe($user, "{$this->morphWord($vehicleType)} {$mark->name}");
     $this->subscribe($user, $mark->name . ' ' . $model->name);
     if ($user->cars()->save($car)) {
         $imgCollection = Image::findMany(Input::get('img'));
         foreach ($imgCollection as $imgObject) {
             $car->images()->save($imgObject);
         }
         return $this->respond($this->collectionTransformer->transformCar($car));
     }
     return $this->respondServerError();
 }