Breeze
Breeze
Laravel 11 mein anchored button (jisko click karne par kisi specific route par le jaye) banana
bohot asaan hai. Tum route() function ka use kar ke easily anchor tag ya button create kar sakte
ho. Aao isko ek simple example se samajhte hain.
Sabse pehle tumhe web.php file mein ek named route define karna hoga:
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\HomeController;
Yahan name('home') ka matlab hai ke is route ka naam home hoga, jo hum HTML ya Blade
file mein use karenge.
Ab kisi bhi Blade template (e.g., welcome.blade.php) mein anchored button add kar lo:
Ya agar tum button tag use karna chahte ho, to yeh method use karo:
Agar HomeController abhi tak nahi hai, to terminal par yeh command run karo:
use Illuminate\Http\Request;
Final Result
Ab jab bhi tumhara button click hoga, user /home route par chala jayega, jahan
HomeController@index method execute hoga.
Laravel Breeze ek lightweight authentication package hai jo Laravel mein authentication system
ko bohot asaan banata hai. Yeh built-in authentication (login, register, logout, password reset,
etc.) provide karta hai aur beginner-friendly hai.
Agar tumhare paas Laravel project nahi hai, to pehle ek naya Laravel project create karo:
cd myproject
Agar pehle se Laravel install hai to is step ko skip kar sakte ho.
Yeh tumse poochega ke tum kis frontend stack ko use karna chahte ho. Agar tum sirf Blade
templates use karna chahte ho to blade choose kar lo.
Breeze authentication system ke liye kuch database tables chahiye, jo migrations se create hongi.
Migration run karne ke liye:
Yeh command users, password resets, sessions aur authentication se related tables create kar
degi.
Agar tum Tailwind CSS aur frontend assets ko use kar rahe ho to NPM dependencies install
karo:
Agar tumhe frontend ki zaroorat nahi hai, to is step ko skip kar sakte ho.
Sab kuch ready-to-use hota hai! Tum sirf apni customization add kar sakte ho.
Agar tum apni authentication system ko customize karna chahte ho, to ye files modify kar sakte
ho:
resources/views/dashboard.blade.php
Is file ko modify kar sakte ho aur apne hisaab se design change kar sakte ho.
🎉 Conclusion
Laravel Breeze ek simple aur fast authentication package hai jo beginners ke liye best hai. Sirf
install karo, migrate karo, aur use karo – koi extra configuration ki zaroorat nahi!