PHP code example of haokeed / laravel-extend-database
1. Go to this page and download the library: Download haokeed/laravel-extend-database library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
haokeed / laravel-extend-database example snippets
use Illuminate\Database\Eloquent\Model;
use Haokeed\LaravelExtend\Database\Eloquent\SEvents;
class Category extends Model
{
use SEvents;
}
namespace Haokeed\LaravelShop\Data\Goods\Models;
use Illuminate\Database\Eloquent\Model as laravelModel;
use Haokeed\LaravelExtend\Database\Eloquent\SEvents;
class Model extends laravelModel
{
use SEvents;
}
namespace Haokeed\LaravelShop\Data\Goods\Providers;
use Illuminate\Support\ServiceProvider;
use Haokeed\LaravelShop\Data\Goods\Models\Model;
class GoodsServiceProvider extends ServiceProvider
{
public function boot()
{
Model::observe();
}
}