Catatan

Menunjukkan catatan yang berlabel laravel

.htaccess

 <IfModule mod_rewrite.c>     <IfModule mod_negotiation.c>         Options -MultiViews -Indexes     </IfModule>     RewriteEngine On     # Handle Authorization Header     RewriteCond %{HTTP:Authorization} .     RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]     # Redirect Trailing Slashes If Not A Folder...     RewriteCond %{REQUEST_FILENAME} !-d     RewriteCond %{REQUEST_URI} (.+)/$     RewriteRule ^ %1 [L,R=301]     # Send Requests To Front Controller...     RewriteCond %{REQUEST_FILENAME} !-d     RewriteCond %{REQUEST_FILENAME} !-f     RewriteRule ^ index.php [L] </IfModule>

Laravel RBA using middleware

  Refer to Chatgpt https://chat.openai.com/share/9489242f-f2da-454e-ae3b-67a10036542e In Laravel, middleware is a way to filter HTTP requests entering your application. Middleware can be assigned to routes to perform various tasks before or after the request enters the controller. To create middleware for user and admin roles, you can follow these steps: 1. **Create Middleware:**    You can create middleware using the following Artisan command:    ```bash    php artisan make:middleware CheckRole    ```    This will generate a `CheckRole` middleware class in the `App\Http\Middleware` directory. 2. **Modify the Middleware:**    Open the `CheckRole` middleware class (`App\Http\Middleware\CheckRole.php`) and implement the logic to check the user role. Here's a simple example:    ```php    <?php    namespace App\Http\Middleware;    use Closure;    use Illuminate\Support\Facades\Auth;    class CheckRole    {        public function handle($request, Closure $next, $role)        {      

DOCKER command

Imej
  show list of docker image service > docker ps > docker ps -a run container image > docker run hello-world > docker run nginx // run nginx in detach mode > docker run -d nginx > docker run php:8.1-alpine start/stop a container > docker start acdb > docker stop acdb remove docker >docker rm <imageid> image apa yg kita ada > docker image ls > docker images -a check network > docker network > docker network ls run nginx untuk specific container > docker exec -it nginx_app_1 nginx -t > docker exec -it nginx_app_1 nginx -s reload > docker run -d --name nginx-app -p 80:80 nginx cleanup docker env > docker system prune -a untuk run compose, multiple image in one command only > docker compose check logs > docker logs 1ddd run mysql > docker run -d -e MYSQL_ROOT_PASSWORD=123456 mysql docker tagging - alpine 9linuxOS0 - forker access docker container using command > docker exec -it eaduan2-server-1 sh

PHP Artisan command

Imej
Reset env > php artisan view:clear > php artisan route:clear >php artisan route:cache > php artisan optimize > php artisan migrate:fresh --seed Create view  > php artisan make:view about Create Model > php artisan make:Model Report -mc Create controller  > php artisan make:controller UserController > php artisan make:controller ReportResourceController --resource Create request > php artisan make:request StoreReportRequest Create Seeder (dummy data) > php artisan make:seeder ReportSeeder > php artisan db:seed Migrate database > php artisan make:migration create_reports_table > php artisan migrate How to cache > php artisan clear > php artisan config:cache > php artisan route:cache > php artisan view:cache Untuk deployment Autoloader optimization > composer install --optimize-autoloader --no-dev

Apa itu Role-based access control (RBAC) ?

Imej
  What is Role-Based Access Control | RBAC vs ACL & ABAC

Laragon phpmyadmin mysql reset password

Imej
  Command >  mysql -u root > ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

LARAVEL 9

  How to Install Bootstrap in Laravel 9? https://medium.com/@laraveltuts/how-to-install-bootstrap-in-laravel-9-ef36be699bb6 How to Install Bootstrap 5 in Laravel 9 With Vite https://techvblogs.com/blog/how-to-install-bootstrap-5-in-laravel-9-with-vite Laravel Database Migration https://laravel.com/docs/9.x/authentication#starter-kits Laravel Authentication https://laravel.com/docs/9.x/authentication#starter-kits