PHP code example of yaangvu / laravel-base

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

    

yaangvu / laravel-base example snippets


  YaangVu\LaravelBase\Provider\GeneratorServiceProvider::class,

  public function register()
  {
      if ($this->app->isLocal()) {
          $this->app->register(\YaangVu\LaravelBase\Provider\GeneratorServiceProvider::class);
      }
      // ...
  }

Route::base('/posts', \App\Domains\Post\Controllers\PostController::class);

class UserService extends BaseService implements \YaangVu\LaravelBase\Base\Contract\ShouldCache
{}
shell
php artisan vendor:publish --provider="YaangVu\LaravelBase\Providers\BaseServiceProvider"
shell
php artisan yaangvu:base Post <option>

├── app
│   ├── Domains
│   │   └── Post
│   │       ├── Controllers
│   │       │   └── PostController.php
│   │       ├── Models
│   │       │   └── Post.php
│   │       └── Services
│   │           └── PostService.php

class UserService extends BaseService
{
    public function storeRequestValidate(object $request, array $rules = []): bool|array
    {
        $rules = [
            'username' => '

class UserService extends BaseService
{
    public function updateRequestValidate(int|string $id, object $request, array $rules = []): bool|array
    {
        $rules = [
            'username' => '