Category

Uncategorized

Category

How can i remove extra “s” from django admin panel? Add new class inside model class called Meta  in your model to specify plural display name. Example, if you have model name is Blog, in the admin panel displays Blogs  Blogs, now just add Meta class, we can change it to Blogs. I have changed your code to fix the issue: class Blog(models.Model): title = models.CharField(max_length=200, default=”) slug = models.SlugField(max_length=200, default=”) created_on = models.DateTimeField(auto_now_add=True) updated_on = models.DateTimeField(auto_now= True)…

Laravel 8 Highcharts Step 1: Download laravel 8 project composer create-project –prefer-dist laravel/laravel highcharts Step 2: Configure Your database from .env file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel1Db DB_USERNAME=root DB_PASSWORD=root@123 Step 3: Create controller and put below code in your controller php artisan make:controller BlogContoller <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\Blog; class BlogController extends Controller { public function getRecord() { $blogs = Blog::select(\DB::raw(“COUNT(*) as count”)) ->whereYear(‘created_at’, date(‘Y’)) ->groupBy(\DB::raw(“Month(created_at)”)) ->pluck(‘count’); return view(‘chart’, compact(‘blogs’)); } } Step 4:…

Laravel 7 Highcharts Step 1: Download laravel 7 project composer create-project –prefer-dist laravel/laravel blog Step 2: Configure Your database from .env file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel1Db DB_USERNAME=root DB_PASSWORD=root@123 Step 3: Create controller and put below code in your controller php artisan make:controller BlogContoller <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Blog; class BlogController extends Controller { public function getRecord() { $blogs = Blog::select(\DB::raw(“COUNT(*) as count”)) ->whereYear(‘created_at’, date(‘Y’)) ->groupBy(\DB::raw(“Month(created_at)”)) ->pluck(‘count’); return view(‘chart’, compact(‘blogs’)); } } Step 4:…

Laravel 6 Multiple Database Connection Tutorial Step1: Install Laravel using composer composer create-project –prefer-dist laravel/laravel blog “6.*” Step 2: Configure Database from .env file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel1Db DB_USERNAME=root DB_PASSWORD=root@123 DB_CONNECTION_SECOND=mysql2 DB_HOST_SECOND=127.0.0.1 DB_PORT_SECOND=3306 DB_DATABASE_SECOND=laravel2Db DB_USERNAME_SECOND=root DB_PASSWORD_SECOND=root@123 Step 3: Configure Database from config/database.php <?php use Illuminate\Support\Str; return [ ‘default’ => env(‘DB_CONNECTION’, ‘mysql’), ‘connections’ => [ ….. ‘mysql’ => [ ‘driver’ => ‘mysql’, ‘url’ => env(‘DATABASE_URL’), ‘host’ => env(‘DB_HOST’, ‘127.0.0.1’), ‘port’ => env(‘DB_PORT’, ‘3306’), ‘database’ => env(‘DB_DATABASE’,…