I am very beginner Laravel programmer. I have in my project Laravel 5.8.
I have this code:
-
Migration:
Schema::create('statistics', function (Blueprint $table) { $table->bigIncrements('id'); $table->bigInteger('company_id')->unsigned(); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade'); $table->text('agent')->nullable(); $table->dateTime('date')->nullable(); $table->ipAddress('ip'); $table->bigInteger('user_id')->default(0); $table->string('browser', 70)->nullable(); $table->string('platform', 70)->nullable(); $table->string('language', 12)->nullable(); $table->string('url_address', 160)->nullable(); $table->engine = "InnoDB"; $table->charset = 'utf8mb4'; $table->collation = 'utf8mb4_unicode_ci'; });
-
Model:
class Statistics extends Model { protected $quarded = ['id']; protected $fillable = ['company_id', 'agent', 'date', 'ip', 'user_id', 'browser', 'platform', 'language', 'url_address']; public $timestamps = false; }
In html form I have 2 input:
1. Show statistics from ...... (date input)
2. Show statistics to ..... (date input)
I want show statistics for url_address ='demo-user'.
I need to display information about unique users and total users in a selected period of time.
How to do it?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2B67LgT
via IFTTT
Aucun commentaire:
Enregistrer un commentaire