PHP code example of leandrowkz / laravel-basis

1. Go to this page and download the library: Download leandrowkz/laravel-basis 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/ */

    

leandrowkz / laravel-basis example snippets


protected $service;
protected $request;
public function all();
public function find(string $id);
public function create(array $data);
public function update(string $id, array $data);
public function delete(string $id);
public function exists($id);
public function validate();
public function service(BaseServiceInterface $service = null);

protected $model;
public function all();
public function find(string $id);
public function query($where);
public function create(array $data);
public function update(string $id, array $data);
public function delete(string $id);
public function model(string $model = null);

protected $foo = 1;
protected $bar = 2;
$this->foo(); // returns 1;
$this->bar(); // returns 2;
$this->foo(3); // sets $this->foo as 3;
$this->bar(3); // sets $this->bar as 3;

protected $customService = MyService::class; // string
$this->customService; // string
$this->mutateProps();
$this->customService; // MyService object