/** * Run the migrations. * * @return void */ public function up() { Schema::create('settings', function (Blueprint $table) { $table->increments('id'); $table->string('laralum_version'); $table->string('website_title'); $table->string('logo'); $table->string('button_color'); $table->string('header_color'); $table->string('pie_chart_source'); $table->string('bar_chart_source'); $table->string('line_chart_source'); $table->string('geo_chart_source'); $table->timestamps(); }); $settings = new Settings(); $settings->laralum_version = "2.1.3"; $settings->website_title = env('APP_NAME', 'My Application'); $settings->logo = ''; //Default logo will load $settings->button_color = "blue"; $settings->header_color = "#1678c2"; $settings->pie_chart_source = "highcharts"; $settings->bar_chart_source = "highcharts"; $settings->line_chart_source = "highcharts"; $settings->geo_chart_source = "highcharts"; $settings->save(); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('settings')->delete(); $settings = new Settings(); $settings->email = '*****@*****.**'; $settings->description = 'Уникальность нашего сайта состоит в том, что покупатель выставляет свое объявление, а продавец автомобиля ищет именно то, объявление, где есть сходство с его автомобилем!'; $settings->save(); }
/** * Store new account * */ public function store(Request $request) { $user = new User(); $user->name = $request->input('name'); $user->username = $request->input('username'); $user->email = $request->input('email'); $pass = $request->input('password'); $user->role = 'Owner'; if (!empty($pass)) { $user->password = bcrypt($pass); } $user->save(); // Create Company $company = new Company(); $company->name = $request->input('company_name'); $company->email = $request->input('company_email'); $company->address1 = $request->input('address1'); $company->address2 = $request->input('address2'); $company->city = $request->input('city'); $company->postcode = $request->input('postcode'); $company->url = strtolower(str_replace(' ', '', $request->input('company_name'))); $company->save(); $user->company_id = $company->id; $user->update(); $company->user_id = $user->id; $company->update(); $settings = new Settings(); $settings->application_id = 1; $settings->references_id = 0; $settings->company_id = $company->id; $settings->save(); $refs = new ReferenceFields(); $refs->settings_id = $settings->id; $refs->company_id = $company->id; $refs->save(); $options = new Settings(); $options->references_id = 1; $options->application_id = 0; $options->company_id = $company->id; $options->save(); flash()->success('Success', 'Account successfully created'); return back(); }
public function settingParam(Request $request) { if ($this->auth->user()->rank != 3) { abort(403); } $value = $request->get('insure_var'); $insure = DB::table('settings')->where('name', 'insure')->first(); if ($insure && $insure->value_associated == 1 or $insure && $insure->value_associated == 0) { if ($value) { DB::table('settings')->where('name', 'insure')->update(array('value_associated' => 1)); } else { DB::table('settings')->where('name', 'insure')->update(array('value_associated' => 0)); } } else { $settings = new Settings(); $settings->action = 'SETTINGS'; $settings->value_associated = $value; $settings->name = 'insure'; $settings->save(); } $alias_name = $request->get('alias_name'); $alias = DB::table('settings')->where('name', 'alias')->first(); if ($alias && $alias->value_associated == 1 or $alias && $alias->value_associated == 0) { if ($alias_name) { DB::table('settings')->where('name', 'alias')->update(array('value_associated' => 1)); } else { DB::table('settings')->where('name', 'alias')->update(array('value_associated' => 0)); } } else { $settings = new Settings(); $settings->action = 'SETTINGS'; $settings->value_associated = $alias_name; $settings->name = 'alias'; $settings->save(); } return redirect(action('AdminController@settings'))->with('success', 'L\'action à bien été effectuer'); }