PHP code example of mosweed / laravel-auto-crud

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

    

mosweed / laravel-auto-crud example snippets


// Filter
GET /products?status=active
GET /products?price_from=10&price_to=100
GET /products?search=keyword

// Sort
GET /products?sort=name&direction=asc

// Soft Deletes
GET /products?trashed=1
bash
php artisan crud:layout --welcome
bash
php artisan vendor:publish --tag=auto-crud-config
bash
php artisan make:crud Post
bash
# BelongsTo
php artisan make:crud Post --belongsTo=User --belongsTo=Category

# HasMany
php artisan make:crud User --hasMany=Post

# BelongsToMany
php artisan make:crud Post --belongsToMany=Tag
bash
php artisan make:crud --json=crud.json
bash
php artisan crud:layout
bash
# Layout + welcome page together
php artisan crud:layout --welcome

# With Bootstrap
php artisan crud:layout --css=bootstrap --welcome

app/
├── Http/Controllers/
│   ├── ProductController.php
│   └── Api/ProductController.php
├── Http/Requests/Product/
│   ├── StoreProductRequest.php
│   └── UpdateProductRequest.php
├── Models/Product.php
└── Policies/ProductPolicy.php

database/
├── factories/ProductFactory.php
├── migrations/xxxx_create_products_table.php
└── seeders/ProductSeeder.php

resources/views/
├── components/app-layout.blade.php
├── welcome.blade.php
└── products/
    ├── index.blade.php
    ├── create.blade.php
    ├── edit.blade.php
    └── show.blade.php