PHP code example of arnaldo-tomo / laravel-autoscema
1. Go to this page and download the library: Download arnaldo-tomo/laravel-autoscema 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/ */
arnaldo-tomo / laravel-autoscema example snippets
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
protected $fillable = ['name', 'email', 'age'];
protected $casts = [
'email_verified_at' => 'datetime',
'preferences' => 'json',
];
public function posts()
{
return $this->hasMany(Post::class);
}
}
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CreateUserRequest extends FormRequest
{
public function rules()
{
return [
'name' => '