Laravel? Ajax ???? ?????
???? ???? ??? ???? ?? ?? ? ??????? ??? ??? ?? ?? ??? ?? ? ???? ????. ??? ???????? ???? ???? ?????. ?? ??? ????? ??? ?? ? ??? ??? ???? ??? ?? ?? ??? ?????, ?? ??? ?? ?? ?? ???? ?? ???? ??? ?? ??? ???? ???. ??? ??? ???. ??? ??? ??? ??? Ajax ???? ?? ?????.
Laravel ?????? ??? ??? ???? Ajax ???? ?? ??? ? ??? ????. ? ????? Laravel? ???? Ajax ???? ???? ??? ?????.
- ??? ??
?? Ajax ???? ????? ???? ???? ???. web.php ??? ?? ??? ?????:
Route::get('/posts',?'PostController@index'); Route::get('/posts/fetch_data',?'PostController@fetch_data');
- Create Controller
???? ??? ??? ????? ???? ???. Laravel?? PostController? ????? ?? ??? ?????:
php?artisan?make:controller?PostController
PostController? ?? ??? ?????:
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Post; class PostController extends Controller { public function index() { $posts = Post::paginate(5); return view('posts.index', compact('posts')); } public function fetch_data(Request $request) { if($request->ajax())?{ ????????????$posts?=?Post::paginate(5); ????????????return?view('posts.data',?compact('posts'))->render(); ????????} ????} }
??? ???? ?? ?? paginate ???? ?????. fetch_data ?????? data?? ???? ?? ???? ??? ?? ???? ??????.
<div class="row"> ????@foreach($posts?as?$post) ????????<div class="col-md-6"> ????????????<div class="card mb-3"> ????????????????<img class="card-img-top" src="{{ $post->image?}}"?alt="{{?$post->title?}}"> ????????????????<div class="card-body"> ????????????????????<h5 class="card-title">{{?$post->title?}}</h5> ????????????????????<p class="card-text">{{?$post->excerpt?}}</p> ????????????????????<a href="{{ route('posts.show', $post) }}" class="btn btn-primary">Read?More</a> ????????????????</div> ????????????</div> ????????</div> ????@endforeach </div>
- Create View
?? ??? ???? ???? Ajax ??? ??? ????? ?? ???? ???. resources/views/posts/index.blade.php ??? ?? ??? ?????:
@extends('layouts.app') @section('content') ????<div class="container"> ????????<div id="posts"> ????????????@include('posts.data') ????????</div> ????????<div class="d-flex justify-content-center"> ????????????{{?$posts->links()?}} ????????</div> ????</div> @endsection @section('scripts') ????<script> ????????$(document).ready(function()?{ ????????????$(document).on('click',?'.pagination?a',?function(e)?{ ????????????????e.preventDefault(); ????????????????var?page?=?$(this).attr('href').split('page=')[1]; ????????????????fetch_data(page); ????????????}); ????????}); ????????function?fetch_data(page) ????????{ ????????????$.ajax({ ????????????????url:"/posts/fetch_data?page="+page, ????????????????success:function(data) ????????????????{ ????????????????????$('#posts').html(data); ????????????????} ????????????}); ????????} ????</script> @endsection
???? data.blade.php? ???? ????? ??? ?? ??? ????? ?? ????? @pagination ???? ??????. @scripts ?????? jQuery? ???? ?? ???? ???? ???? ??????.
- ??? ???
????? ???? ? ??? ???? ? ?? ???? ???? ???. public/css/app.css ??? ?? ??? ?????:
.card?{ ????border:?none; } .card-text?{ ????color:?#555; } .card-img-top?{ ????height:?220px; ????object-fit:?cover; }
?? Laravel ??????? Ajax ??? ??? ??? ??? ?????! ???? ??? ?? ??? ???? ???? ?? ??? ?? ???? ?????. ?? ?? ??? ?? ?? ?? ? ??? ??? ?? ???? ? ????.
??
? ???? Laravel ?????? ???? Ajax ???? ???? ??? ?????. Ajax ??? ??? ???? ?? ??? ??? ? ?? ? ??????? ??? ??? ?? ???? ? ????. Laravel ?????? ???? ? ??? ?? ???? ??????? ???? ? ????. ? ??? ??? ??? ????!
? ??? Laravel?? Ajax ???? ???? ??? ?? ?????. ??? ??? 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)

TOWORKEFCITIVE WITHPIVOTTBLESINLARAVEL, FIRDSCESSPIVOTDATAUSINGWITHPIVOT () ORWITHTIMESTAMPS (), thenupdateentrieswithupdatee XistingPivot (), ManagerElationshipsviadetach () andsync (), andusecustompivotmodelswheneded.1.usewithpivot () toincludescificcol

Laravel ?? ???? 4 ?? ?? ??? ?? ?? ???? ???? ???? ? ????. 1. ?? ????? ???? ?? ??? ??? ??? ?? ???? ??? ???? ?????? ??? ??? ????? ?? ??? ?? ???? ??? ??????. 2. ???? ?? ????? ??????? ?????, n 1 ??? ???, ?? ??? ????, ??? ??, ??? ?? ? ?? ? ?? ??, ?? ??? ????. 3. ?? ?? ?? ? ?? ???? ??? ??? ?? ?? ??? ? ??? ???? ???? ???? ???? ???? ? ?? ????? ??????. 4. ??? ?? ? ???? ??? ??? ??? ?? ???? ????? ?? ?????? ????? ?? ???? ? ??? ?? ??? ????? ??????.

Laravel ????? ?????? ??? ???? ???? RefreshDatabase ??, ??? ??? ??, ?? ??? ?? ? ??? ?? ?? ??? ?????. 1. ?? ??? ???? ? ???? ??? ??????? ??????? ???? ?? ?????? ??? ???? ?????????. 2. ?? ??? ???? ??? ???? ??? ?? ???? ?? ?? ???? ?????. 3. DatabasEtransactionStrait? ???? ??? ?? ??? ????? ? ?????????. 4. ???? ???? ???? ??????? ???? ??? ? ?? ? ??????? ?? ??????. ??? ??? ???? ???? ???? ???? ?? ??? ? ??? ??? ?? ???? ?????.

Laravelsanctum? SPA ?? ??? ??????? ?? ???? ?? API ??? ??? ?? ??? ?? OAUTH2 ??? ??? ????? ?????. 1. Sanctum? ?? ?? ??? ????, ??? ???? ?????. 2. Passport? ?? ?? ? ????? ?? ??? ?? ??? ????? ????, ?? ???? ?????? ?????. 3. ?? ?? ? ??? ? ???? ?? ?? ??? ????. 4. ?? ??? ?????? ??? ???? ??? ?? ??? ??? ???? ?????. ??? ? ???? ?? ??? ?? OAUTH2 ??? ???? ??? ???????.

Laravel? ?? ???? ?????? ???? ??? ??????. 1. DB :: Transaction () ???? ???? ??? ???? ???? ?? ?? ?? ?? ?? ??; 2. ?? ? ????? ???? ?? ???? ?? ????? ????? ?? ???? ??? ???? ???? ??? ?? ????. 3.?? ??? ??? ??? ????? ??? begintransaction (), commit () ? rollback ()? ?? ?? ?? ??? ?????. 4. ?? ???? ??? ?? ????, ??? ?? ??, ??? ?? ? ?? ?? ??? ?????. ????? ?? ?? ??? ???? ?? ???? ??? ? ??? ???? ? ????.

Laravel?? ??? ??? ??? ???? ?? ???? ??? Route () ??? ??? ???? ????. Route () ??? ??? ?? ??? ???? ??? ???? ???? ?? ?? ???? ???? ????. 1. Route ( 'user.profile', [ 'id'=> 1])? ?? ???? ????? ?? ??? ?? ??? ?????. 2. ?? ?? ?? ? ? ?? ? ?????? ??? Route ( 'user.post.show', [ 'id'=> 1, 'postId'=> 10]? ?? ??? ??? ??? ????. 3. ??? ????? ?? ???? ???? ?? ?? ? ? ????. 4. ??? ?? ??? ???? ??? Route ( 'user.post',

Laravel?? HTTP ?? ? ??? ???? ??? ?? ???, ?? ?? ? ?? ???? ??? ????? ????. 1. ?? ???? ?? ? ? ?? ????? ?? ?? ????? ???? input () ?? ?? ???? ???? ??? ?? ??? ?? validate () ?? ?? ?? ???? ?? ? ? ????. 2. Return Response? ???,??, JSON, ?? ?? ? ??? ?? ?? ? ???? ??? ?????. 3. ?? ???? ?? ? ?? ?? () ??? ? Store ()? ???? ??? ???????. ????? ?? ?? ?? ? ??? ?????? ???? ??? ??????? ??? ? ????.

Laravel? ??? ?? ??? ?? ???? ?? ?????. ?? ??? ??? ????. 1. ?? ???? ?? ?? ?????. 2. Phpartisanqueue? ?? ???? ??? ? ? ?? ??? ?????? : Work- Queue = High, Default; 3. onqueue () ???? ???? ??? ?? ? ? ? ??? ??????. 4. Laravelhorizon ? ?? ??? ???? ??? ??? ?????? ?????. ?? ?? ?? ?? ?? ? ??? ???? ????? ?? ??? ?? ??? ?? ?????.
