How to solve Invalid default value for ‘created_at’ while adding new column in database.

[Problem:] While adding new column to the table by alter method, I used this sql code   ALTER TABLE investments ADD bank TEXT; ERROR 1067 (42000): Invalid default value for ‘created_at’   But An eeror came thought I tried various data type ERROR 1067 (42000): Invalid default value for ‘created_at’   [solution] The problem in my database is current mode is in the sql_mode   SO, in the sql I typed and hit the commend set global sql_mode = ‘ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION’;     and it solved the problem.

HOW TO ADD A NEW COLUMN TO EXISTING DATABASE [LARAVEL]

First of all make a new migration php artisan make:migration add_mobile_to_userinfo 2. put this code in up() function public function up() { Schema::table(‘users’, function($table) { $table->integer(‘mobile’); }); }   3. put this code in down() function public function down() { Schema::table(‘users’, function($table) { $table->dropColumn(‘mobile’); }); }   4. Migrate the databse php artisan migrate   … Read moreHOW TO ADD A NEW COLUMN TO EXISTING DATABASE [LARAVEL]

How to Pass Value from Model to all the views in Laravel ? with video

It is a bit tricky to pass all the values to the view from the model in laravel. First of all, make controllers and model is a must. I believe you have already done this In controller: View::composer(‘*’, function($views){ $views->with(‘settings’, App\Setting::all()); });   In Views: (according to my video) @foreach($settings as $setting) @if($setting->facebook!=null) <a class=”iconfont-wrapper” … Read moreHow to Pass Value from Model to all the views in Laravel ? with video

Cant Delete File in Laravel? [SOLUTION]

[Q] I am using laravel and while deleting a file in laravel It got error while code is live but worked fine in localhost. Error Looked like this controller is as follow public function destroy($id) { $del=Slider::find($id); if (!empty($del->image)) { $image_path = public_path(“images/slider/{$del->image}”); //File::delete($image_path); unlink($image_path); } $chk=$del->delete(); if($chk){ $data=Slider::get(); Session()->flash(‘msg’,’A Slider has been deleted.’); return … Read moreCant Delete File in Laravel? [SOLUTION]

Be careful when using Facebook! Photos uploaded to Couple Challenge appeared on the porn sites

Under the recently launched Couple Challenge on the popular social network Facebook, photos uploaded by users with their partners have started appearing on various porn sites. According to news agencies, some of the photos uploaded to the Couples Challenge, especially of celebrity couples, have been uploaded on porn sites. Security officials say those who are … Read moreBe careful when using Facebook! Photos uploaded to Couple Challenge appeared on the porn sites