改进
This commit is contained in:
parent
b8549903f8
commit
89442913f0
@ -23,9 +23,9 @@ DB_PASSWORD=secret
|
||||
|
||||
MONGO_DB_HOST=127.0.0.1
|
||||
MONGO_DB_PORT=27017
|
||||
MONGO_DB_DATABASE=homestead
|
||||
MONGO_DB_USERNAME=homestead
|
||||
MONGO_DB_PASSWORD=secret
|
||||
MONGO_DB_DATABASE=
|
||||
MONGO_DB_USERNAME=
|
||||
MONGO_DB_PASSWORD=
|
||||
MONGO_DBDB_AUTHENTICATION_DATABASE=admin
|
||||
|
||||
LARAVELS_LISTEN_IP=127.0.0.0
|
||||
|
25
app/Models/Transaction.php
Normal file
25
app/Models/Transaction.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Jenssegers\Mongodb\Eloquent\Model;
|
||||
|
||||
|
||||
class Transaction extends Model
|
||||
{
|
||||
// $t = (new App\Models\Transaction)->create(['name' => 1])
|
||||
|
||||
protected $connection = 'mongodb';
|
||||
protected $collection = 'transactions';
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'time',
|
||||
'created_at'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name'
|
||||
];
|
||||
}
|
@ -25,6 +25,10 @@
|
||||
|
||||
$app->withFacades();
|
||||
|
||||
|
||||
$app->register(Jenssegers\Mongodb\MongodbServiceProvider::class);
|
||||
|
||||
|
||||
$app->withEloquent();
|
||||
|
||||
/*
|
||||
@ -116,7 +120,6 @@
|
||||
$app->register(\Anik\Form\FormRequestServiceProvider::class);
|
||||
$app->register(App\Providers\RouteBindingServiceProvider::class);
|
||||
|
||||
$app->register(Jenssegers\Mongodb\MongodbServiceProvider::class);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('transactions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('transactions');
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user