Skip to content

Washira/laravel-10-filament-employees

Repository files navigation

Laravel Logo

Build Status Total Downloads Latest Stable Version License

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

You may also try the Laravel Bootcamp, where you will be guided through building a modern Laravel application from scratch.

If you don't feel like reading, Laracasts can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.

Premium Partners

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

About Configure The Project

Setup This Project

After you have installed PHP and Composer, you can create a new Laravel project via the Composer create-project command:

composer create-project laravel/laravel filament-employees

In this case, we choose the project name is filament-employees.

After the project has been created, start Laravel's local development server using the Laravel's Artisan CLI serve command:

cd filament-employees/

php artisan serve

or you can start the server after all installation processes would be complete.

Install Breeze

You may install Laravel Breeze using Composer.

composer require laravel/breeze --dev

You may run the breeze:install Artisan command.

php artisan breeze:install

See more details of Breeze here

Migration Data from Database

You may migrate data for this project

First, you should config db environment on .env's DB_ parts.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

Then, you may connect your database using db workbrench, The example is Tableplus.

See more detail of Tableplus here.

Next, migrate data from the database.

php artisan migrate

You may see the result in command like below.


   INFO  Preparing database.

  Creating migration table .................................................................................... 23ms DONE

   INFO  Running migrations.

  2014_10_12_000000_create_users_table ........................................................................ 11ms DONE
  2014_10_12_100000_create_password_reset_tokens_table ......................................................... 7ms DONE
  2019_08_19_000000_create_failed_jobs_table ................................................................... 6ms DONE
  2019_12_14_000001_create_personal_access_tokens_table ....................................................... 10ms DONE

The migration data has been successfully.

Install Filament

To get started with the admin panel, you can install it using the command:

composer require filament/filament:"^2.0"

Each time you upgrade Filament, you need to run the filament:upgrade command. We recommend adding this to your composer.json's post-update-cmd:

"post-update-cmd": [
    // ...
    "@php artisan filament:upgrade"
],

If you don't have one, you may create a new user account using:

php artisan make:filament-user

You will see the result and have to type Name, Email Address, and Password just like below:

 Name:
 > admin	

 Email address:
 > admin@admin.com

 Password:
 >

In this case, we select name as admin and email as admin@admin.com, if you type too short password, this message will be displayed:

The password field must be at least 8 characters.

 Password:
 >

If you typed password succussfully, the success message would display like this.

Success! admin@admin.com may now log in at http://localhost/admin/login.

You may comeback to start server using the Laravel's Artisan CLI serve command:

php artisan serve

See the result

INFO  Server running on [http://127.0.0.1:8000].  

Press Ctrl+C to stop the server

See the panel on browser by local ip:

http://127.0.0.1:8000/admin/login

Fix Login Attempt

Add number of times to login for prevent user too many attempt.

See in app > Http > Controllers > Auth > AuthenticatedSessionController.php to notice a function store a login request, we may see LoginRequest inside that.

Go to app > Http > Controllers > Auth > LoginRequest.php for config times of login.

See ensureIsNotRateLimited() for config time of login

...
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
  return;
}
...

In part of this expression, you can change the number of login time (by default is 5) for me, change it to be 3.

...
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 3)) {
  return;
}
...

and see in authenticate().

...
if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
  RateLimiter::hit($this->throttleKey(), 350);

  ...
}
...

Add another parameter in hit (after $this->throttleKey()) with a number for config duration when over the limit of attemption login.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages