ram56

validate($request,[
‘proimg’=>’required’,
‘dob’=>’required’,
‘gender’=>’required’,
‘location’=>’required’
]);*/
//$data = User::get();

//return $data;

/*$userId = $data->id;

return $userId;*/

$hold_pro_img=$request->proimg;
//return $hold_cat_img;
$pro_new_img=rand() . ‘.’ . $hold_pro_img->getClientOriginalName();
//return $cat_new_img;
$destination=’assets/img’;
//return $destination;
$hold_pro_img->move($destination, $pro_new_img);

$profiletVal = Profile::create([
‘proimage’=>$pro_new_img,
‘dob’=>$request->dob,
‘gender’=>$request->gender,
‘location’=>$request->location,
‘user_id’=>Auth::user()->id,
]);

}

public function CreateCategory()
{
$data = ParentCat::all();
return view(‘admin.create-category’)->with([‘getData’=>$data]);
}

/* public function InsertCategory(Request $request)
{
$this->validate($request,[
‘catname’=>’required’
]);

if (!empty(Input::get(‘parentid’)) )
{
$parentId=Input::get(‘parentid’);
}
else
{
$parentId=0;
}

$hold_cat_img=Input::file(‘catimg’);
$cat_new_img=$hold_cat_img->getClientOriginalName();
$destination=’assets/img’;
$hold_cat_img->move($destination, $cat_new_img);

$catVal = Cat::create([
‘cat_name’=>$request->catname,
‘parent_id’=>$parentId,
‘images’=>$parentId,
]);

$catImg = CatImage::create([
‘images’=>$cat_new_img,
‘cat_id’=>$catVal->id
]);

return redirect(url(‘create-category’));

}
*/

public function InsertCategory(Request $request)
{
$validatedData = $request->validate([
‘catname’ => ‘required’,
‘catimg’ => ‘required|image|mimes:jpeg,png,jpg,gif,svg|max:2048’
]);

if (empty(Input::get(‘parentid’)) )
{
$parentname=Input::get(‘catname’);

$hold_cat_img=Input::file(‘catimg’);
$cat_new_img=rand() . ‘.’ . $hold_cat_img->getClientOriginalName();
$destination=’assets/img’;
$hold_cat_img->move($destination, $cat_new_img);

$parentVal = ParentCat::create([
‘parent_name’=>$parentname,
‘parent_img’=>$cat_new_img,
]);

//return $parentVal;

}
else
{
$childVal = ChildCat::create([
‘child_name’=>$request->catname,
‘parent_cat_id’=>$request->parentid,
]);

}
return redirect(‘create-category’)->with(‘msg’,’Parent Category Created’);
}

public function CatList()
{
$data = ParentCat::with(‘getChildCat’)->get();

//return $data;
return view(‘admin.cat-list’)->with([‘getData’=>$data]);
}

public function EditCat($id)
{
$data = ChildCat::with(‘ParentCat’)->where(‘id’,$id)->first();
//return $data;

return view(‘admin.edit-cat’)->with([‘getData’=>$data]);
}

public function UpdateCategory(Request $request, $id)
{
ChildCat::where(‘id’,$id)->update([
‘child_name’=>$request->catname,
‘parent_cat_id’=>$request->parentcat,
]);

return redirect(‘cat-list’);
}

public function getChildId($id)
{
//return $id;

$data = ChildCat::where(‘parent_cat_id’,$id)->get();
//$data = DB::table(‘child_cats’)->where(‘id’,$id)->get();

//return $data;

echo ‘‘;

foreach($data as $row)
{
echo ‘‘;
}
}*/

public function CreateProduct()
{
$data=ParentCat::with(‘getChildCat’)->get();
//return $data;
return view(‘admin.create-product’)->with([‘getData’=>$data]);
}

public function InsertProduct(Request $request){

$hold_cat_img=Input::file(‘pimage’);
$p_new_img=$hold_cat_img->getClientOriginalName();
$destination=’assets/img’;
$hold_cat_img->move($destination, $p_new_img);

$childVal = product::create([
‘product_name’=>$request->prodname,
‘product_image’=>$p_new_img,
‘parent_cat_id’=>$request->pid,
‘child_cat_id’=>$request->cid,
‘price’=>$request->prodprice,
‘payment’=>implode(‘,’, $request->payment),
‘specification’=>serialize($request->specification),
‘size’=>implode(‘,’, $request->size),
‘description’=>$request->description,
]);

return redirect(‘list-product’);
}

public function ListProduct(){
$data = Product::with(‘ChildCat’,’ParentCat’)->get();

//return $data;
return view(‘admin.list-product’)->with([‘getData’=>$data]);
}

public function EditProduct($id)
{
$data = Product::with(‘ChildCat’,’ParentCat’)->where(‘id’,$id)->first();

//return $data;

return view(‘admin.edit-product’)->with([‘getData’=>$data]);
}

public function UpdateProduct(Request $request, $id){

//return $id;

/*Product::find($id)->update($request->all());*/

if ($request->pimage==null || $request->pimage==”)
{
$p_new_img=$request->prodhiddenimg;
}
else
{
$hold_cat_img=Input::file(‘pimage’);
$p_new_img=$hold_cat_img->getClientOriginalName();
$destination=’assets/img’;
$hold_cat_img->move($destination, $p_new_img);
}

product::where(‘id’,$id)->update([
‘product_name’=>$request->prodname,
‘product_image’=>$p_new_img,
‘parent_cat_id’=>$request->pid,
‘child_cat_id’=>$request->cid,
‘price’=>$request->prodprice,
‘payment’=>implode(‘,’, $request->payment),
‘specification’=>serialize($request->specification),
‘size’=>implode(‘,’, $request->size),
‘description’=>$request->description,
]);

return redirect(‘list-product’)->with(‘msg’,’Now kindly Verify Your Email Address’);
}

public function Slider(){
return view(‘admin.slider’);
}

public function InsertSlider(Request $request)
{
$validatedData = $request->validate([
‘slidername’ => ‘required’,
‘sliderimg’ => ‘required’,
]);

$hold_cat_img=Input::file(‘sliderimg’);
$p_new_img=$hold_cat_img->getClientOriginalName();
$destination=’assets/img’;
$hold_cat_img->move($destination, $p_new_img);

$sliderVal = Slider::create([
‘title’=>$request->slidername,
‘slider_images’=>$p_new_img,

]);

Slider::where(‘id’,$sliderVal->id)->update([
‘position’=> $sliderVal->id,
]);

return redirect(‘slider’)->with(‘msg’, ‘Slider has been inserted’);

}

public function StatusSlider($id, $status)
{
$zero = 0;
$one = 1;

if ($status == 1)
{
Slider::where(‘id’,$id)->update([
‘status’=>$zero,
]);
}
else
{
Slider::where(‘id’,$id)->update([
‘status’=>$one,
]);
}

return redirect(‘list-slider’)->with(‘msg’,’Slider has been Updated’);

}

public function ListSlider()
{
$data = Slider::orderBy(‘position’, ‘ASC’)->get();
//return $data;
return view(‘admin.list-slider’)->with([‘getData’=>$data]);
}

public function ChangeSlider()
{
$i = 0;

foreach ($_POST[‘item’] as $value) {
$i++;
DB::table(‘sliders’)->where(‘id’, ‘=’, $value)->update([ ‘position’ => $i ]);
}
}

public function EditSlider($id)
{
$data = Slider::where(‘id’,$id)->first();
//return $data;
return view(‘admin.edit-slider’)->with([‘getData’=>$data]);
}

public function UpdateSlider(Request $request, $id)
{
if ($request->sliderimg==null || $request->sliderimg==”)
{
$getSliderName = $request->hiddenslider;
//echo $hiddenSliderImg;
}
else
{
$getSliderImgInfo=Input::file(‘sliderimg’);
//echo $getSliderImg;
$getSliderName=$getSliderImgInfo->getClientOriginalName();
//echo $getSliderName;
$destination=’assets/img’;
$getSliderImgInfo->move($destination, $getSliderName);
}
Slider::where(‘id’,$id)->update([
‘title’=>$request->slidername,
‘slider_images’=>$getSliderName,
]);

return redirect(‘list-slider’)->with(‘msg’,’Now kindly Verify Your Email Address’);
}

public function DeleteSlider($id)
{
/*$itemName = Slider::find($id);
$itemName ->delete(); this can be tried*/
Slider::destroy($id);
return redirect(‘list-slider’)->with(‘success’, ‘Item Has Been Delete’);
}

public function Search(){

$data = ChildCat::with(‘getProduct’)->get();
//return $data;
return view(‘search’)->with([‘getData’=>$data]);

}

public function List(){
return view(‘seach2’);
}

public function auto(Request $request){
$term = $request->term;
$items = Product::where(‘product_name’, ‘LIKE’, ‘%’.$term.’%’)->get();
if (count($items)==0) {
$searchResult[] = ‘No Item found’;
}
else
{
foreach ($items as $key => $value) {
$searchResult[] = $value->product_name;
}
}

return $searchResult;
}

public function showSearch($id)
{
//return $id;
$data = ChildCat::with(‘getProduct’)->where(‘child_name’,$id)->get();
//return $data;
return view(‘search-view’)->with([‘getData’=>$data]);
}

public function AutoSearch($id)
{
//return $id;
$data = Product::where(‘product_name’,$id)->get();
//return $data;
return view(‘auto-search-view’)->with([‘getData’=>$data]);
}

public function Sortable(){
$data = DB::table(‘sortables’)->orderBy(‘order’, ‘asc’)->get();

//return $data;
return view(‘sortable’,compact(‘data’));
}

public function SortableUp()
{
$i = 0;

foreach ($_POST[‘item’] as $value) {
$i++;
DB::table(‘sortables’)->where(‘id’, ‘=’, $value)->update([ ‘order’ => $i ]);
}
}

/*Other Project code for learning and suggestion*/

public function BlogList()
{
//$data = User::with(‘blog.image’,’blog.CommenFun’,’profile’)->get();
$data = User::with(‘ProfileFn’,’BlogFn.BlogImage’,’BlogFn.CommenFun’)->get();//Bulid connection as join, here //Bulid connection as join, here in the bracket we are calling the model function name.
//return $data;
return view(‘blog-list’)->with([‘getData’=>$data]);
}

public function BlogView($id)
{
//return $id; check what is getting….
$data = Blog::with(‘BlogImage’,’CommenFun.user’,’user’)->where(‘id’,$id)->first();/*Why not accepting after changing function name anything and getting null value*/
//return $data;
return view(‘blog-view’)->with([‘getData’=>$data]);
}

public function AdminWelcome()
{
$user = Auth::guard(‘web’)->user();
$userCount=User::count();/*we wrting here direct model name as model knowing*/
$blogCount=Blog::count();
$commentCount=Comment::count();
//return $userCount;

//return $user;
return view(‘admin-welcome’)->with([
‘user’=>$user,
‘userCount’=>$userCount,
‘blogCount’=>$blogCount,
‘commentCount’=>$commentCount,

]);
}

public function OddEven()
{
//$data = User::with(‘blog.image’,’blog.CommenFun’,’profile’)->get();
$data = Blog::with(‘BlogImage’,’CommenFun.user’,’user’)->get();//Bulid connection as join, here //Bulid connection as join, here in the bracket we are calling the model function name.
//return $data;
return view(‘odd-even’)->with([‘getData’=>$data]);
}

}

get();

//return $data;
// return view(‘users-detail’)->with([‘getData’=>$data]);
//}

public function register()
{
return view(‘register’);
}

public function RegisterInsert(Request $request)
{

$validatedData = $request->validate([
‘name’ => ‘required’,
’email’ => ‘required|unique:users|max:255’,
]);

$user = User::create([ /*this User is model name*/

‘name’ => $request->input(‘name’),
‘role’ => $request->input(‘role’),
’email’ => $request->input(’email’),
‘password’ => bcrypt($request->input(‘password’)),
‘verify_token’ => Str::random(40),

]);

Mail::send(‘mail’, [‘data’ => $user], function ($m) use ($user) {
$m->from(‘raminfotech13@gmail.com’, $user[‘name’]);
$m->to($user[’email’],’Blog Website’)->subject(‘This is email confirmation mail ‘);
});

return redirect(‘login-ui’)->with(‘msg’,’Now kindly Verify Your Email Address’);
}

/*public function VerifyEmailFirst()
{
return view(‘verify-email-first’);
}*/

public function VerifyUser($email, $verifytoken)
{
//return $verifytoken;
$user = User::where([’email’=>$email, ‘verify_token’=>$verifytoken])->first();
//return $user;
if ($user)
{
$getData = User::where([’email’=>$email, ‘verify_token’=>$verifytoken])->update([‘status’=>’1’,’verify_token’=>NULL]);

//return $getData;
return redirect(‘login-ui’)->with(‘msg’,’Successfully registered Now proceed to login’);

}
else
{
return ‘User Not Found’;
}
/*$data = User::all()->where(’email’,$email)->where(‘status’,0)->first();
if ($data) {
return redirect(url(‘register’));
}
else
{
return redirect(url(‘verify-email-first’));
}*/

}

public function LoginView()
{
return view(‘login’);
}

public function LoginInsert(Request $request)
{
$this->validate($request,[
’email’ => ‘required’,
‘password’ => ‘required’
]);

$credentials = [
’email’ => $request->input(’email’),
‘password’ => $request->input(‘password’),
‘status’ => 1,
];

$auth = auth()->guard(‘web’);

if(!$auth->attempt($credentials))
{

return redirect(‘login-ui’)->with(‘msg’,’Sorry!!! details are incorrect.’);
}
return redirect(‘dashboard’);

}

public function AdminWelcome()
{
$user = Auth::guard(‘web’)->user();
$userCount=User::count();/*we wrting here direct model name as model knowing*/

//return $user;
return view(‘admin.admin-welcome’)->with([
‘user’=>$user,
‘userCount’=>$userCount,
]);
}

public function Logout()
{
session()->flush();
return redirect(“login”);
}

/*
public static function Header(){
$data = ParentCat::with(‘getChildCat’)->get();
return $data;

}*/

public function Index()
{

$data = Slider::where(‘status’,1)->orderBy(‘position’, ‘ASC’)->get();
//return $data;
return view(‘index’)->with([‘getData’=>$data]);

}

public function ProductList($id){
//return $id;
$data = Product::where(‘child_cat_id’,$id)->get();
//$data = Product::with(‘ChildCat’)->where(‘child_cat_id’,$id)->get();
//return $data;
return view(‘product-list’)->with([‘getData’=>$data]);
}

/* public function RatingContrlr()
{
$data = Product::select(‘id’)
->with([‘getRating’ => function($q){
$q->select(‘product_id’,DB::Raw(‘count(product_id) AS product_count’),DB::Raw(‘format(avg(rating),1) AS avg_rating’));
$q->groupBy(‘product_id’);
}])

->get()->toArray();

return redirect(‘rating-system’);
}*/

public function ProductDetail($id)
{
$data = Product::where(‘id’, $id)->with([‘getComment’,’getRating’ => function($q){
$q->select(‘product_id’,DB::Raw(‘count(product_id) AS product_count’),DB::Raw(‘format(avg(rating),1) AS avg_rating’));
$q->groupBy(‘product_id’);
}])

->get()->toArray();

//return $data;
return view(‘product-detail’)->with([‘getData’=>$data]);

}

public function ParentProducts($id)
{
//return $id;
$data = Product::where(‘parent_cat_id’, $id)->get();
//return $data;
return view(‘parent-products’)->with([‘getData’=>$data]);
}

public function RatingSystem()
{
$data=Rating::all();
return view(‘rating-system’)->with([‘getData’=>$data]);
}

public function InsertRating(Request $request, $id)
{

$getData = Rating::find($id);

$postHits=$getData[‘hits’];

$oldRate=$getData[‘points’];

if ($currentRates=$request->currentrates > 0)
{
$currentRates=$request->currentrates;

/* $plusRate=;*/

//return $plusRate;
Rating::where(‘id’,$id)->update([

‘hits’=>$postHits+1,
‘points’=>$currentRates+$oldRate,
]);

$getData = Rating::where(‘id’,$id)->first();

//return $getData->hits;

$freshRate=$getData->points/$getData->hits;

$rateData = Rating::where(‘id’,$id)->update([
‘points’=>$freshRate,
]);

return redirect(‘rating-system’);

}
else
{
echo “please rate first”;
}

}

//$data = Point::avg(‘point’);
//$data = Post::with(‘getRating’)->get();
//return $data;
/*$data=Post::select(‘id’,’title’)->with([‘getrating’=>function($q){
$q->select(‘post_id’,DB::Raw(‘count(post_id) AS post-count’),DB::Raw(‘format(avg(rating),1) AS avg_rating’));
$q->groupBy(‘post_id’);

}])
->get()->toArray();*/

public function Post()
{

$data = Post::select(‘id’,’title’)
->with([‘getRating’ => function($q){
$q->select(‘post_id’,DB::Raw(‘count(post_id) AS post_count’),DB::Raw(‘format(avg(point),1) AS avg_rating’));
$q->groupBy(‘post_id’);
}])

->get()->toArray();

//return $data;
return view(‘post’)->with([‘getData’=>$data]);
}

public function PostDetail($id)
{
//return $id;
$data = Post::where(‘id’,$id)->first();
//return $data;
return view(‘post-detail’)->with([‘getData’=>$data]);
}

public function Pointings(Request $request, $id, $point)
{
Point::create([
‘post_id’=>$id,
‘point’=>$point,
]);

return redirect(“post”);
}

public function CreateComment(Request $request)
{

$comment = Comment::create([
‘comment’=>$request->comment,
‘user_id’=>$request->userid,
‘product_id’=>$request->productid,
]);
// return $comment;
return Redirect::back();

}

public function RatingRoute(Request $request, $id, $rating)
{
Rating::create([
‘rating’=>$rating,
‘product_id’=>$id,
]);

return redirect(‘product-detail/’.$id);

//return Redirect::back()->with(‘msg’,’register has been done successfully’);
}

public function PrivacyPolicy()
{
return view(‘privacy-policy’);
}

public function AjaxTest(Request $request)
{
/* $getval=$_POST[‘sendVal’];*/
if(request()->ajax()) {
$data = $request->sendVal;
return $data;
}

return view(‘ajax-test’);
}

public function NewSearch(Request $request)
{
$term = $request->term;

$items = ChildCat::where(‘child_name’, ‘LIKE’, ‘%’.$term.’%’)->get();
//return $items;
if (count($items)==0) {
$searchResult[] = ‘No Item found’;
}
else
{
foreach ($items as $key => $value) {
$searchResult[] = $value->child_name;
}
}
return $searchResult;
}

public function NewSearchResult($name)
{
$data = ChildCat::with(‘getProduct’)->where(‘child_name’,$name)->get();
//return $data;
return view(‘new-search-result’)->with([‘getData’=>$data]);
}

}








jQuery UI Sortable – Default functionality




    @foreach($data as $row)

  • 1
    {{$row->title}}

@endforeach





Laravel


Search

@foreach($getData as $rowData)
@foreach($rowData->getProduct as $rowChild)

Product Name : {{$rowChild->product_name}}

Price :

@endforeach
@endforeach


Leave a comment

Your email address will not be published. Required fields are marked *

How it works for an SEO

As we are into digital marketing for the past many years and we have worked on many web project to achieve the our goal so that we can provide the quality work for our clients, so we have few steps which we have mention below, so these are the steps on which we work to make our client happy.

Find Keywords

On page Optimization

Off page Optimization

Reach Target

How it works for Web Development

Web Designing and Development is very creative and logical things for this we have creative designer who understands our client requirements, as per that designing and development done by our developer who loves to play with code.


Designing

Development

Testing

Delivery

Why Choose Rank Lift Technologies

Rank Lift Technologies is a global information technology & seo company and well known as SEO Services India, we are very focused and committed to empowering business transformation of our client and we love seo marketing. These are facts that you will choose us as we are best seo company We work on our Client satisfaction which full filled their business goal, as we are very dedicated towards our work respect the punctuality of time delivery the project before deadline, full our commitment so that our client would not get disappointed.



Focus on Result

Strong Technical Team

Client Satisfaction

Trustworthy

No Hidden Cost

Contact us here