? ?????? ??? ? ??? ?? ??? ?????. Laravel ??? ??? ???. ?? ??? ???? ??? ??? ? ????. ???? ??????? ???? ?? ??? ???? ?? ? ??? ?????. ?? ????.
? ??? ??
- Laravel: Laravel ????? ???? ??? ?????.
- ??? ?: Laravel? .env ??? APP_KEY? ???? ?????. ? ?? Laravel? ??? ????? ?????.
? ?1??: ???? ??? ??
????? Laravel? encrypt() ? decrypt() ??? ???? ??? ??? ?? ??? ? ???? ???? ?????.
? ?Doctor Model
??? ? ??? ??? ???? Doctor ??? ????? ???????. first_name, last_name, email, mobile ?? ??? ??????? ???? ?? ??????.
<?phpnamespace AppModels;use IlluminateDatabaseEloquentModel;use IlluminateSupportFacadesCrypt;class Doctor extends Model{ protected $fillable = [ 'first_name', 'last_name', 'email', 'mobile', 'hashed_email', 'password' ]; // Automatically encrypt attributes when setting them public function setFirstNameAttribute($value) { $this->attributes['first_name']?=?encrypt($value); ????} ????public?function?setLastNameAttribute($value) ????{ ????????$this->attributes['last_name']?=?encrypt($value); ????} ????public?function?setEmailAttribute($value) ????{ ????????$this->attributes['email']?=?encrypt($value); ????} ????public?function?setMobileAttribute($value) ????{ ????????$this->attributes['mobile']?=?encrypt($value); ????} ????//?Automatically?decrypt?attributes?when?getting?them ????public?function?getFirstNameAttribute($value) ????{ ????????return?decrypt($value); ????} ????public?function?getLastNameAttribute($value) ????{ ????????return?decrypt($value); ????} ????public?function?getEmailAttribute($value) ????{ ????????return?decrypt($value); ????} ????public?function?getMobileAttribute($value) ????{ ????????return?decrypt($value); ????}}
???????
- Setter ??: set{AttributeName ?? }???? ??????? ???? ?? ???? ????? ??().
- Getter ??: ???????? ???? ??? ? get{AttributeName}Attribute()? ???? ???? ?????.
2??: ??? ?? ? ??? ?? ????
?????? ??? ???? ??? ??? ? ????. ???? ???/??? ?? ?? ???? ?? ?????.
? ?????DoctorController
DoctorController? ???? ???? ??? ?????.
???? ???? ??? ?? ????? ??????? ?????.
?? ???? ??? ? ???? ??? ?????.
??? ?????.
<?phpnamespace AppHttpControllers;use IlluminateHttpRequest;use AppModelsDoctor;use IlluminateSupportFacadesHash;class DoctorController extends Controller{ public function register(Request $request) { // Validate the incoming request $validatedData = $request->validate([ ????????????'first_name'?=>?'required|string|max:255', ????????????'last_name'?=>?'required|string|max:255', ????????????'email'?=>?'required|string|email|max:255|unique:doctors,email', ????????????'mobile'?=>?'required|string|size:10|unique:doctors,mobile', ????????????'password'?=>?'required|string|min:8|confirmed', ????????]); ????????//?Hash?the?email?to?ensure?uniqueness ????????$hashedEmail?=?hash('sha256',?$validatedData['email']); ????????//?Create?a?new?doctor?record?(model?will?handle?encryption) ????????$doctor?=?Doctor::create([ ????????????'first_name'?=>?$validatedData['first_name'], ????????????'last_name'?=>?$validatedData['last_name'], ????????????'email'?=>?$validatedData['email'], ????????????'hashed_email'?=>?$hashedEmail, ????????????'mobile'?=>?$validatedData['mobile'], ????????????'password'?=>?Hash::make($validatedData['password']), ????????]); ????????return?response()->json([ ????????????'message'?=>?'Doctor?registered?successfully', ????????????'doctor'?=>?$doctor ????????],?201); ????} ????public?function?show($id) ????{ ????????//?Fetch?the?doctor?record?(model?will?decrypt?the?data?automatically) ????????$doctor?=?Doctor::findOrFail($id); ????????return?response()->json($doctor); ????}}
? ???
- ?? ??: ???? ??? ????, ??? ?? ??? ????, ??? ??? ??? ?? ??, ?, ???, ???? ?? ??? ???? ??????.
- show ???: ID?? ?? ??? ?????. ??? ??? getter ???? ??? ??? ???? ?????. ???? ?????.
? ?3??: ?????? ??
??? ???? ?? doctor ??? ?? ??? ???? ???(????? TEXT ?? LONGTEXT)? ????? ??? ???? ?????.
?? ?????? ??:
Schema::create('doctors',?function?(Blueprint?$table)?{ ????$table->id(); ????$table->text('first_name'); ????$table->text('last_name'); ????$table->text('email'); ????$table->string('hashed_email')->unique();?//?SHA-256?hashed?email ????$table->text('mobile'); ????$table->string('password'); ????$table->timestamps();});
??: ???? ?? ?? ????? ?? ? ? ???? ?? ???? ???? TEXT? ?????.
? ?4??: ?? ?? ?? ??
?? ?? ??? ?? ?? getter? try-catch ??? ?? ?? ??? ?????.
<?phpnamespace AppModels;use IlluminateDatabaseEloquentModel;use IlluminateSupportFacadesCrypt;class Doctor extends Model{ protected $fillable = [ 'first_name', 'last_name', 'email', 'mobile', 'hashed_email', 'password' ]; // Automatically encrypt attributes when setting them public function setFirstNameAttribute($value) { $this->attributes['first_name']?=?encrypt($value); ????} ????public?function?setLastNameAttribute($value) ????{ ????????$this->attributes['last_name']?=?encrypt($value); ????} ????public?function?setEmailAttribute($value) ????{ ????????$this->attributes['email']?=?encrypt($value); ????} ????public?function?setMobileAttribute($value) ????{ ????????$this->attributes['mobile']?=?encrypt($value); ????} ????//?Automatically?decrypt?attributes?when?getting?them ????public?function?getFirstNameAttribute($value) ????{ ????????return?decrypt($value); ????} ????public?function?getLastNameAttribute($value) ????{ ????????return?decrypt($value); ????} ????public?function?getEmailAttribute($value) ????{ ????????return?decrypt($value); ????} ????public?function?getMobileAttribute($value) ????{ ????????return?decrypt($value); ????}}
? ??? ?? ??
- ?? ??: APP_KEY? .env ??? ???? ???? ??? ?????. ? ?? ???/???? ?????.
- ??? ??: ??? ???? ??? ?? ??? APP_KEY ?? ???? ???? ??? ? ???? ?? ????? ??? ??????.
? ???
- ?? ???: ???? ???? ?? setter ???? ???? ?????, ?? ? ???? ????? getter ???? ?????.
- ???? ??: ????? ?? ??? ?? ?? ???? ??? ?? ??? ? ????. .
- ?????? ??: ?????? TEXT ?? LONGTEXT ?? ?????. ??.
- ?? ?? ??: APP_KEY? ???? ?? ?? ??? ?? getter?? ?? ??? ?????.
? ??? Laravel? ??? ??? ? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











Laravel?? ???? ??? ???? ??? ?????. 1) ??? ? ???? ?? ???? ?? ??; 2) ?? ?? ? ??? ??? ???. 3) Artisan Command? ???? ??? ?? ?? ??; 4) ?? ??? ???? ??; 5) Packagist? ?? ?? ? ?? ??; 6) ??? ??? ??; 7) ??? ?? ??; 8) ?? ?? ???? ??? ??.

????? Laravel? ??? ?????? HTTP ??? ?? ?? ???? ? ?????. ?? ?? : 1. ???? ?? : "Phpartisanmake : Middlewarecheckrole"??? ??????. 2. ?? ?? ?? : ?? ? ??? ?? ??? ????. 3. ???? ?? : kernel.php? ????? ??????. 4. ???? ?? : ??? ??? ????? ??????.

Laravel? ??? ?? ??? ? ??? ??? ?? ???? ? ????. 1) ?? ?? ??? ???? ?? :: ?? ???? ?? ??? ??? ??????. 2) Redis? ?? ??? ?? ???? ??????. 3) ??? ??? ?????? ???? ??? ?? ?? ??? ???? ???? ??? ?? ? ????. 4) ?? ???? ??? ??, ?? ? ?? ????? ?????. ??? ??? ????? ?????? ? ??? ??? ????? ???? ? ????.

laravel'smvcarchitecturecanfaceseveralissues : 1) fatcontrollerscanbeavoidedBydegingLogicToServices.2) ??? modelsshouldFocusOndataAccess.3) viewsshouldRemainsimple, ???.

Laravel? ??? ???? ??? ?? Seeder? ???? ?? ?? ?????? ?? ???? ??????. ??????? ???? ??? ?? ??? ???? ?? ?????? ??? ? ?? ??? ???? ?? ? ????. Laravel?? Seeder? ??????? ??? ? ???? ?????. ?? ? ???? ?????? ??? ???? ???? ???? ? ??? ? ? ????. Seeder? ???? ??? ?? ??? ??? ??? ???? ???? ?? ? ?? ? ?? ???? ?? ?????. ??????? ?? ??? ???? ?? ?? ?? ?? ? ??? ???? ??????? ? ???? Seeder? ??????. ??? ???? ??? ???. ??, ??? ??? ??? ??????

Laravel? ??????? ???? ?????? ?? ??? ????? ???? ???? ?? ? ??? ?????? ?? ?? ?????. 1. ?? ??? ???? ?????? ??? ????. 2. ?????? ???? ?? ?????? ???? ??/?? ? ??? ???? ?? ??? ???? ????. 3. PhpartisanGiGrate ??? ???? ??????? ???? PhpartisanMigrate : ???? ???? ??????.

Laravel? ???? MVC ????? ??? ? ?????. 1) LARAVEL ?? : ComposerCreate-Project? ?????. -Prefer-Distlaravel/Laravelyour-Project-Name ??. 2) ??, ???? ??? ?? : ??? ??? ????, ?? ??? ?? ??? ????, ??? ????, ??? ??? ???? ?? ? ? ????. 3) ??? ?? : Routes/Web.php? ??/??? ?? ??. ? ??? ?? ??? ??? ?? ????? ???? Laravel ? MVC? ?? ??? ??? ? ? ????.

Inlaravel, PoliciesorganizeauthorizationLogicFormodELACTIONS.1. POLICIESARECLASSESSWITHMEDSLIKEVIEW, ??, ???? ? ???? ? DELETETHETTRUEORFALSEBASEDONUSERMISSIONS.2. TOREGISTERAPOLICY, MAPTHETEMODELTOITSPOLIDEINTHEATHOUSPOFOFAOFAOFOFAOFOFOFOFOFOFOFOFOFOFOFORRAY.
