This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<my-component inline-template> | |
<h1>@lang('users.edit') {{ $user->name }}</h1> | |
<form method="post" action="{{ route('users.update', ['user' => $user]) }}"> | |
{!! csrf_field() !!} | |
<input name="_method" type="hidden" value="PATCH"> | |
<!-- Some form fields --> | |
<button type="submit">{{ __('button.update') }}</button> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters: | |
# Adds a fallback DATABASE_URL if the env var is not set. | |
# This allows you to run cache:warmup even if your | |
# environment variables are not available yet. | |
# You should not need to change this value. | |
env(DATABASE_URL): '' | |
doctrine: | |
dbal: | |
driver: 'pdo_mysql' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters: | |
# Adds a fallback DATABASE_URL if the env var is not set. | |
# This allows you to run cache:warmup even if your | |
# environment variables are not available yet. | |
# You should not need to change this value. | |
env(DATABASE_URL): '' | |
doctrine: | |
dbal: | |
driver: 'pdo_mysql' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- cp .env.test_cached.dist .env.test_cached | |
- set -a && source .env.test_cached && set +a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Requests; | |
use App\Models\BlogPost; | |
use Illuminate\Foundation\Http\FormRequest; | |
class PostStoreRequest extends FormRequest | |
{ | |
public function rules() | |
{ | |
return array_merge(BlogPost::$createRules, Author::$createRules); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
use App\Models\BlogPost; | |
class PostController extends Controller | |
{ | |
public function store(Request $request) | |
{ | |
$validatedData = $request->validate(BlogPost::$createRules); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Requests; | |
use App\Models\BlogPost; | |
use Illuminate\Foundation\Http\FormRequest; | |
class PostStoreRequest extends FormRequest | |
{ | |
public function rules() | |
{ | |
return BlogPost::$createRules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
class PostController extends Controller | |
{ | |
public function store(Request $request) | |
{ | |
$validatedData = $request->validate([ | |
'title' => 'required|unique:posts|max:255', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Requests; | |
use Illuminate\Foundation\Http\FormRequest; | |
class PostStoreRequest extends FormRequest | |
{ | |
public function authorize() | |
{ | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
use App\Http\Requests\SingingCircleRequest; | |
class PostController extends Controller | |
{ | |
public function store(PostStoreRequest $request) | |
{ | |
// You can just pull the data out of PostStoreRequest |