PHP code example of mamunhoque / laravel-crud-builder
1. Go to this page and download the library: Download mamunhoque/laravel-crud-builder 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/ */
mamunhoque / laravel-crud-builder example snippets
// Automatically generated in service
if ($request->filled('category_id')) {
$query->where('category_id', $request->input('category_id'));
}
// In service
$data['featured_image'] = $this->s3FileUpload($request, 'featured_image', 'posts')['path'] ?? null;
// In model
public function getFeaturedImageUrlAttribute(): ?string
{
if ($this->featured_image) {
return config('filesystems.disks.s3.url') . '/' . $this->featured_image;
}
return null;
}
bash
# Generate for public API (no authentication)
php artisan make:advanced-crud Post --middleware=public
# Generate for authenticated users
php artisan make:advanced-crud Post --middleware=auth
# Custom route prefix
php artisan make:advanced-crud Post --prefix=v1/api
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.