This file contains hidden or 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
| function showForm(Request $request) { | |
| $request->session()->now('status-danger', 'There was an error!'); | |
| } | |
| // Or ... | |
| function processForm(Request $request) { | |
| if ($failed_for_some_reason) { | |
| return redirect()->back()->flash('status-danger', 'Oops! There was an error.'); | |
| } |
This file contains hidden or 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
| <a href="https://www.nachi.org/verify.php?nachiid=NACHI97010103" target="_blank"><img src="https://www.nachi.org/webseals/seal-t.gif?nachiid=NACHI97010103" width="98" height="102" alt="Certified by the International Association of Certified Home Inspectors" border="0" /></a> |
This file contains hidden or 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 CmsController extends Controller | |
| { | |
| public function index() | |
| { |
This file contains hidden or 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 | |
| $key = '[[ KEY ]]'; | |
| $userData = [ | |
| 'avatarURL' => $user->avatarURL, | |
| 'email' => $user->email, | |
| 'id' => $user->id, | |
| 'name' => $user->name | |
| ]); |
This file contains hidden or 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
| const babelOpts = { | |
| 'presets': ['react', 'es2015', 'stage-0'], | |
| 'plugins': ['syntax-dynamic-import'], | |
| }; | |
| const config = {}; | |
| config.module = { | |
| rules: [ | |
| { |
This file contains hidden or 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 | |
| class ConvertLineEndingsToCRLF | |
| { | |
| public function handle($request, Closure $next) | |
| { | |
| $response = $next($request); | |
| return $response->setContent( | |
| str_replace("\n", "\r\n", $response->getContent()) | |
| ); |
This file contains hidden or 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 | |
| class Foobar | |
| { | |
| function setFoo($foo) | |
| { | |
| $this->foo = $foo; | |
| } | |
| function setBar($bar) |
This file contains hidden or 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 | |
| // these are the same… | |
| public function create(array $attributes = []) | |
| { | |
| $instance = $this->newModelInstance($attributes); | |
| $instance->save(); | |
| return $instance; | |
| } |
This file contains hidden or 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 | |
| // Redirect /bar to /foo | |
| Route::get('/foo', 'FooController')->was('/bar'); | |
| // Redirect /my-dashboard to /account/dashboard | |
| // It seems like 'was' should always be absolute, even in a group | |
| Route::group(['prefix' => 'account'], function() { | |
| Route::get('/dashboard', [ | |
| 'as' => 'account.dashboard', |
This file contains hidden or 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
| import cx from 'classnames'; | |
| const defaultPrefix = 'ais'; | |
| let classMapper = className => className; | |
| const defaultFormatter = (block, elements) => ({ | |
| className: cx( | |
| elements | |
| .filter(element => element !== undefined && element !== false) |