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
! name: PHP / Laravel Goggle | |
! description: Rerank results to boost content related to the PHP programming language and Laravel Framework, duplicated SE spam. | |
! public: true | |
! author: Patrick Curl <[email protected]> | |
! license: MIT | |
$boost=1,site=github.io | |
$boost=1,site=github.com | |
$boost=1,site=reddit.com | |
$boost=3,site=laravel.com |
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 | |
public static function form(Form $form) : Form | |
{ | |
return $form->schema(Tabs::make('Organizations') | |
->tabs([ | |
Tab::make('Tab 1') | |
->schema([...]), | |
Tab::make('Tab 2') | |
->schema([...]), |
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
<template> | |
<Head title="Log in" /> | |
<BreezeValidationErrors class="mb-4" /> | |
<div v-if="status" class="mb-4 text-sm font-medium text-green-600"> | |
{{ status }} | |
</div> | |
<form @submit.prevent="submit"> |
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 | |
public function store(Request $request) | |
{ | |
$loginField = filter_var( | |
$request->input('login'), FILTER_VALIDATE_EMAIL) | |
? 'email' | |
: 'username'; | |
$request->merge([$loginField => $request->input('login')]); | |
$request->validate([ | |
'email' => 'required_without:username|email|exists:users,email', |
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 | |
/** | |
* Attempt to authenticate the request's credentials. | |
* @return void | |
* | |
* @throws \Illuminate\Validation\ValidationException | |
*/ | |
public function authenticate() | |
{ | |
$this->ensureIsNotRateLimited(); |
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 | |
// ... | |
/** | |
* Get the validation rules that apply to the request. | |
* | |
* @return array | |
*/ | |
public function rules() | |
{ |
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 | |
class LoginRequest extends FormRequest | |
{ | |
protected $loginField; | |
protected $loginValue; | |
/** | |
* Prepare the data for validation. | |
* | |
* @return void |
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 | |
public function store(Request $request){ | |
$request->validate([ | |
'username' => 'required|string|max:255|unique:users', | |
'email' => 'required|string|email|max:255|unique:users', | |
'password' => ['required', 'confirmed', Rules\Password::defaults()], | |
]); | |
$user = User::create([ | |
'username' => $request->username, |
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 | |
public function store(Request $request){ | |
$request->validate([ | |
// 'name' => 'required|string|max:255', | |
'username' => 'required|string|max:255|unique:users', | |
'email' => 'required|string|email|max:255|unique:users', | |
'password' => ['required', 'confirmed', Rules\Password::defaults()], | |
]); | |
$user = User::create([ |
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 | |
// ... | |
public function up() | |
{ | |
Schema::create('users', function (Blueprint $table) { | |
$table->id(); | |
$table->string('username')->unique(); | |
$table->string('email')->unique(); | |
$table->timestamp('email_verified_at')->nullable(); | |
$table->string('password'); |
NewerOlder