1. Go to this page and download the library: Download kolirt/laravel-master-model 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/ */
kolirt / laravel-master-model example snippets
use Kolirt\MasterModel\MasterModel;
class Item extends Model
{
use MasterModel;
}
class Item extends Model
{
use MasterModel;
protected $fillable = [
'image',
];
}
class ExampleController extends Controller
{
public function index(Request $request, $id)
{
$data = $request->validate([
'image' => '
$item = Item::query()->with(['phone', 'addresses'])->first();
/**
* All files in the model and in the loaded relations will be deleted
*/
$item->delete();