I want to create a chart. Using the library below. https://charts.erik.cat/adding_datasets.html#database-eloquent-example-2
Query that dynamically reports the number of users for the last 6 months
(with month rows
Sample:
January = 1,
February = 2,
March = 3
...)
The output I want is:
$user_count_chart = [
"2" => 30,
"3" => 41,
"4" => 50,
"5" => 62,
"6" => 72,
"7" => 150,
];
**
- key: month value
- value: number of users
**
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('email')->unique();
$table->string('password');
$table->dateTime('email_verified_at')->nullable();
$table->rememberToken();
$table->timestamps();
});