Laravel? ???? ??? ?? ? ?? ???? ???? ??
Nov 02, 2023 am 11:09 AMLaravel? ???? ??? ?? ? ?? ???? ???? ??
??:
?? ? ? ?? ???? ??? ?? ??? ?? ???? ??? ???? ?? ??? ?? ? ?? ???? ?? ?? ???? ?????. ??????. ? ????? Laravel ?????? ???? ??? ??? ?? ? ?? ???? ???? ?? ?? ??? ?????.
1. ?? ??
???? ?? ?? ??? ???? ???. ???? PHP? Composer? ???? ?? Laravel? ???? ??? ?????.
2. ???? ??
?? ??? ??? ?? ????? ????? ??? ?????. ?? ?? ?? ??? ???? ? Laravel ????? ?????:
composer create-project --prefer-dist laravel/laravel qa-platform
? ??? ?? ??? Laravel? ?????? ???? ?? ????? qa-platform??? ??? ?????.
3. ?????? ??
???? Laravel?? ???? ??????? ???? ???. ???? ?? ?????? .env ??? ?? ? ??? ?? ?? ?? ????.
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret
?????? ??? ????? ??? ?? ??? ?????. ??? ??? ? ?? ??? ???? ?????? ?????? ??? ?????.
php artisan migrate
? ??? ???? ?? ??? ?? ?? ??? ???? ?????.
4. ??? ?? ?? ???
Laravel??? ??? ???? ??????? ?????. ?? ??? ?? ??? ???? ???. ??? ??? ?? ???? ?? ????? ??? ? ?? ??? ?????.
php artisan make:model Question -m php artisan make:model Answer -m
?? ? ? ??? ?? ??? ? ?? ?? ??? ?????.
???? ?????? ?????? ??? ?? create_questions_table.php ??? ?? ??? ?????.
public function up() { Schema::create('questions', function (Blueprint $table) { $table->id(); $table->string('title'); $table->longText('description'); $table->timestamps(); }); }
?? ?? create_answers_table.php ??? ???? ?? ??? ?????.
public function up() { Schema::create('answers', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('question_id'); $table->longText('content'); $table->timestamps(); $table->foreign('question_id')->references('id')->on('questions'); }); }
???? ?? ??? ???? ?????? ??? ?????. migration:
php artisan migrate
?????? ??????? ???? ??????? ??? ????? ? ?? ??? ???? ?????.
5. ???? ? ? ??
??? ??? ??? ???? ????? ???, ???? ???? ?? ?? ???? ???.
?? ??? ??? ?? ???? ?? ????? ??? ? ?? ??? ???? ????? ????.
php artisan make:controller QuestionController --resource php artisan make:controller AnswerController --resource
? ??? ???? app/Http/Controllers ??? ? ?? ??? ???? ?????. ?? ??. QuestionController.php ??? ?? ?? ??? ?????.
public function index() { $questions = Question::all(); return view('questions.index', compact('questions')); } public function create() { return view('questions.create'); } public function store(Request $request) { $question = Question::create([ 'title' => $request->input('title'), 'description' => $request->input('description') ]); return redirect()->route('questions.index'); }
?? ?? AnswerController.php ??? ?? ?? ??? ?????.
public function store(Question $question, Request $request) { $answer = Answer::create([ 'question_id' => $question->id, 'content' => $request->input('content') ]); return redirect()->route('questions.show', $question); }
???? ?? ? ??? ????. resources/views ??? questions ??? ???? ? ?? index.blade.php, create.blade.php, show.blade.php 3?? ? ??? ?????. ?? ?? ?? HTML ??? ? ??? ???? ??? ?? ???? ?????.
6. ??? ??
??? ??? URL? ?? Q&A ???? ???? ? ??? ???? ???? ????.
routes/web.php ??? ?? ?? ??? ?????.
Route::resource('questions', 'QuestionController'); Route::post('questions/{question}/answers', 'AnswerController@store')->name('answers.store');
?? ?? ??? ?????.
7. ?? ??
?? Laravel ?? ??? ???? ?????? Q&A ???? ???? ? ????.
??? ???? ?? ??? ???? ??? ?????.
php artisan serve
?? ?? ????? http://localhost:8000/questions? ???? Q&A ??? ????? ??????.
??:
? ??? ?? Laravel ?????? ???? ??? ??? ?? ? ?? ???? ????? ????? ??, ????, ? ?? ? ?? ?? ??? ?????. ? ??? Laravel ?????? ??? ???? ? ??? ??? ????.
? ??? 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)

PHP?? ?? ??? ???? ? ?? ?? ??? ????. 1. php.ini? ?? ??? ??; 2. ? ?? (? : Apache? Setenv ?? nginx? FastCGI_Param)? ??????. 3. PHP ?????? putenv () ??? ??????. ? ??? Php.ini? ????? ??? ???? ??? ???? ? ?? ??? ?? ???? ????? ???? Putenv ()? ?? ??? ?????. ?? ???? ?? ?? (? : php.ini ?? ? ?? ??)? ???? ????. ?? ?? ??? ??? ?? ??? ????? ???? ?? ????.

Laravel? ?? ??? ?? ?? ??? ?? ?? ??? ???? ??? ??????. ?? ???? ?? ??? ????? ? ???? I/O ?? ? ?? ?? ??? ???? ???? ??? ?? ? ????. 1. ?? ????? ?? ? ? ???????? ??? ????? ?? ???? ??????. 2. ??? ? ??? ?? ? ? PhPartisAnconfig? ?? ???????. 3. ?? ??? ??? ??? ???? ?? ?? ?? ???? ???? ????. 4. ?? ?? ??? ???? ?? ??? ??? .env ??? ???? ?? ???????.

PHP ????? ?? ??? ??? ? ??? ??? CI (Continuous Integration) ????? ???? ? ????. 1. DockerFile? ???? ?? ???, ?? ??, ??? ?? ? ?? ??? ???? PHP ??? ?????. 2. Gitlabci? ?? CI/CD ??? ???? .gitlab-ci.yml ??? ?? ??, ??? ? ?? ??? ???? ?? ??, ??? ? ??? ?????. 3. PHPUNIT? ?? ??? ??? ??? ???? ?? ?? ? ???? ???? ????????. 4. Kubernetes? ?? ?? ?? ??? ???? ?? .yaml ??? ?? ?? ??? ?????. 5. Dockerfile ??? ? ??? ??? ??????

??? ?? ??? PHP ???? ?? ?? ??? ???? ?? ???????. RBAC (Role-Based Access Control) ??? ?? ???, ?? ? ??? ???? ??? ?? ?? ? ??? ?????. ?? ???? ??? ?????. 1. ???, ?? ? ??? ? ???? user_roles ? role_permissions? 3 ?? ?? ???; 2. $ user-> can ( 'edit_post')? ?? ???? ?? ?? ??? ?????. 3. ??? ???? ??? ??????. 4. ?? ??? ???? ?? ?? ?? ? ??? ? ???? ???? ?? ??? ? ?? ??? ?????. 5. ??? ??? ?? ?? ???? ?? ???? "??"? ??????.

Laravel? eloquentscopes? ?? ??? ??? ??? ?????? ?? ?? ??? ????? ?????. 1. ?? ??? ???? ???? ???? ???? Post :: published (); 2. ??? ??? ?? ??? ???? ???? ?? ??? ?? ?? ?? ??? ???? ???? ??? ?????? ??? ???? ???????. 3. ????? ?? ?? ?? ??? ??? ?? ?? ??? ?? ? ? ??? ?? ? ? ?? ?? ??? ?????. 4. ?? ??? ? ??? ?? ???? ? ??? ? ?? ??, ?? ??, ?? ???? ? ?? ?????????.

CreateAhelpers.phpfileInapp/helperswithCustOmFunctionsikeFormatPrice, isactiveroute, andisAdmin.2.addTheFileTothe "??"sectionOfcomposer.jsonUnderAutoLoad.3.runcomposerDump-AUTOLOADTOMAKETHINGTICTIONSGLOBELYAVAILABLE.4.USETHEHELPERFUNCUNTION

?? ?? ?? : ?? ????? PHP? ?? Error_Log ()? ??? ? ????. ????? ???? ??? ?? ??? ?????? ???? ?? ??? ? ?? ??? ???? ??? ?? ???, ??, ?? ? ?? ? ?? ?? ??? ???? ??? ??????. 2. ??? ?? ?? : ??? ??? ??? ??? ? ??? ?? ??? ??? ?? ??? ??? ??????? ??????. MySQL/PostgreSQL? ???? ??? ? ???? ??????. Elasticsearch Kibana? ? ???/? ???? ?????. ???, ??? ?? ? ??? ? ?? ??? ?? ??????. 3. ?? ? ?? ????? : ??, ???, ?? ? ??? ??? ??????. Kibana? ?? ????? PHP ??? ?? ?? ?????? ???? ???? ?????? ???? ??? ? ?? ??? ??? ? ????.

??, ??, ?? ?? ? ?? ??? ???? ?? ??? ?? ? ?? ???? ?????. 2. ?? ???? ???? ?? ??? ??? SONGSTOMONY ? HASMANY ?? ??; 3. ?? ? ? ?? ? ?? ??? ????? (?? ???? ?? ??? ? ??). 4. ?? ? ?? ??? ???? ?? ??? ???? ?? ? ?? ??? ???? ?? ??? ?????. 5. ?? ???? ??? ?? (?? ??)? ???? ?? ????? ??????. 6. ?? ??? ?? ??? ???? Laravel Signature URL? ???? ??? ??????. 7. ? ?? ?? ? ? ?? ??? ?? ?? ??? ?? ??? ?????. ?????? ??, ?? ?? ??? ??????????.
