1. Go to this page and download the library: Download darkghosthunter/lararut 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/ */
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
$validator = Validator::make([
'rut' => '12.343.580-K',
], [
'rut' => [
'
Schema::create('users', function (Blueprint $table) {
$table->rut();
// ...
});
Schema::create('company', function (Blueprint $table) {
$table->rutNullable();
// ...
});
namespace App\Models;
use DarkGhostHunter\Lararut\HasRut;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use HasRut;
// ...
}
echo $user->rut; // "20490006-K"
class User extends Authenticatable
{
use HasRut;
protected const RUT_NUM = 'numero_rut';
protected const RUT_VD = 'digit_rut';
// ...
}
use DarkGhostHunter\Lararut\HasRut;
use DarkGhostHunter\Lararut\RoutesRut;
class User extends Authenticatable
{
use HasRut;
use RoutesRut;
}
Route::get('usuario/{user:rut}', function (User $user) {
return $user;
});
namespace App\Http\Listeners;
use Illuminate\Auth\Events\Lockout;
use App\Notifications\ProbablyForgotHisPassword;
use App\Notifications\SupportReadyToHelp;
use App\Models\User;
class LogFailedAttempt
{
/**
* Handle the event.
*
* @param Lockout $event
* @return void
*/
public function handle(Lockout $event)
{
// Get the RUT from the request input
$rut = rut($event->request->input('rut'));
// If the user who tried exists in the database, notify him.
if ($user = User::where('rut_num', $rut->num)->first()) {
$user->notify(new ProbablyForgotHisPassword());
}
}
/**
* Creates many RUTs.
*
* @return array|\DarkGhostHunter\RutUtils\Rut
*/
public function generateRuts()
{
return rut()->generate(100);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.