massum

massum

Member Since 2 Years Ago

Experience Points 320
Experience
Level
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

05 Aug
2 years ago

massum started a new conversation Required_with In Laravel For Input Filed As Array

i have a table with checkbox as array and textbox as also array. what i want to achieve is when the user checked a checkbox it should validate that input textbox should not be empty.

public function roombooking(Request $request)
    {


      $messsages = array(
        'check.required'=>'No room was selected.Please select room to proceed for booking !',
        'txtnos.required|numeric'=>'Please enter no of persons',
    );
      $rules = array(
        'check'=>'required',
        'txtnos'=>'required_with:data', //txtnos is a array input filed  and data is a array checkbox 
        );
      $validator = Validator::make($request->all(),  $rules,$messsages
            );
      if ($validator->fails()) {

            return Redirect::back()
                ->withErrors($validator)
                ->withinput();
                
        }
}
27 Jul
2 years ago

massum started a new conversation Payumoney Using Softon Indipay

please help me on the following things as i am not sure how to go about it

  1. surl->how to pass the surl when setting the parameters.
  2. In the github documentation it says to add the response code in the redirect url. Please help me on how to set the redirect url and where to write the response code
  3. github documentation says 'Also add the response route to the remove_csrf_check config item to remove CSRF check on these routes. ' Please help me on where to change it
25 Jun
2 years ago

massum started a new conversation How To Access Multiple Result Of Mysql Stored Procedure?

In my stored procedure I have two select statement. which when executed gives two results. how to access both the result in laravel below is my sql query. for eg i m using same select query two.

DELIMITER $$

USE `palaresort`$$

DROP PROCEDURE IF EXISTS `RoomAvailability`$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `RoomAvailability`( IN CheckInDate VARCHAR(10),IN CheckOutDate VARCHAR(10) )
BEGIN
    SELECT
    `roomid`
    , `roomname`
    , `Desc`
    , `price`
   
FROM
    `palaresort`.`t_rooms`;
    
    SELECT
    `roomid`
    , `roomname`
    , `Desc`
    , `price`
   
FROM
    `palaresort`.`t_rooms`;
    
    
       END$$

DELIMITER ;

here is my laravel model code

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

use DB;

class roommaster extends Model
{
    protected $table = 'roommasters';

    public static function RoomAvailability($checkin,$checkout) {
        
        $roommaster[] = DB::select('call RoomAvailability('. $checkin .','. $checkout .')')->fetchall();
        //$roommaster = DB::select('select * from roommasters');
        
        
        dd($roommaster);
        
    }
}
23 Jun
2 years ago

massum left a reply on Pass Data From Ajax To Controller In Laravel

when i run the code as u sugested i get the link in the console "XHR finished loading: GET "http://localhost:8000/roombooking?id=2". but its not redirecting to that page. Kindly suggest me on how to achieve that i m really stuck in here and can't proceed further @Khudadad

massum left a reply on Pass Data From Ajax To Controller In Laravel

what i mean is i want to take the value of one page and send it to another page. As i m new to laravel so i don't know how to go about it. So far i am able to get the data of the view to the controller. but from the controller how to return to another view is what i am not clear about.

massum left a reply on Pass Data From Ajax To Controller In Laravel

but here is the thing, i have written the ajax in the view name 'booking' and i want to display the fetched data from ajax in roombooking. currently the data is getting return to the booking view. not in roombooking page.

massum left a reply on Pass Data From Ajax To Controller In Laravel

now i am able to view the data in the console but its not redirecting to that page. do i need to change. @tomo_pongrac and @Khudadad

massum left a reply on Pass Data From Ajax To Controller In Laravel

still error. in the alert it say object Object. and in the console it shows ''http://localhost:8000/roombooking?id=1 500 (Internal Server Error) @Khudadad

massum left a reply on Pass Data From Ajax To Controller In Laravel

in the console the error is showing ''http://localhost:8000/roombooking?id=1 500 (Internal Server Error)

massum left a reply on Pass Data From Ajax To Controller In Laravel

$.ajax({
          url: 'roombooking',
          type: "get",
          data: {id:data},
           success: function(response){ // What to do if we succeed
               $data = $(response);
              console.log($data); 
              },
            error: function(response){
                alert('Error'+response);
                }
            });
            
    });
it show the value in the console. however if i try to return a view it gives error

return view ('partials.roombooking', compact('data')->render() ;

massum left a reply on Pass Data From Ajax To Controller In Laravel

this is the controller file

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Input;
use App\roommaster;
use DB;
class pagescontroller extends Controller
{
    public function index()
    {
        return view('pages.index');
    }

    public function about()
    {
        return view('pages.about');
    }

    public function room()
    {
        return view('pages.room');
    }
    public function contact()
    {
        return view ('pages.contact');
    }
    public function booking()
    {
        return view ('pages.booking');
             
    }
    public function gallery()
    {
        return view ('pages.gallery');
    }

    public function listofroom(Request $request)
    {
      //$roommasters=roommaster::all();
      
       $checkin = $request->checkin;
       $checkout = $request->checkout;
       $roommaster = roommaster::RoomAvailability($checkin,$checkout);
      //dd($roommaster->toJson());
      return view ('pages.booking')->with('roomname',$roommaster);
    
    }

    public function roombooking(request $request)
    {
     //redirect('pages.roombooking');
     //return 'success';
      $data= $request->dataval;
      return $data;
     // return view ('pages.roombooking') ;
      //return View::make('pages.roombooking')-with(compact('success'));
      //return view('pages.roombooking');

    }
    public function SelectedTableId(Request $request)
    {
     
     return view ('pages.roombooking');
      // return array('name' => $name);
         
    }
    
   
}

massum left a reply on Pass Data From Ajax To Controller In Laravel

this the route file

Route::get('/', '[email protected]'); 
Route::get('about','[email protected]');
Route::get('room','[email protected]');
Route::get('contact','[email protected]');
Route::get('booking','[email protected]');
Route::POST('booking','[email protected]');
Route::get('gallery','[email protected]');

Route::get('roombooking','[email protected]');

massum left a reply on Pass Data From Ajax To Controller In Laravel

yes. let me share you the entire details. the name of the view is booking where i have written the script.

    var checkedRows = [];
    var data=[] ;
    $(function () {
        $('#table').on('check.bs.table', function (e, row) 
          {
     
            checkedRows.push({id: row.roomid});
            console.log(checkedRows);
           
          });
        $('table').on('uncheck.bs.table', function (e, row) {
            $.each(checkedRows, function(index, value) {
            if (value.id === row.roomid) {
              checkedRows.splice(index,1);
            }
          });
          console.log(checkedRows);
          });

        $("#add_cart").click(function() 
        {
          
          $("#output").empty();
          data="";
          $.each(checkedRows, function(index, value) {
            data+=  value.id ;
          // $('#output').append($('<li></li>').text(value.id ));
            
        });
           
          $.ajax({
              url: 'roombooking',
              type: "get",
              data: {id:data},
               success: function(response){ // What to do if we succeed
              if(data == "success")
            alert(response); 
        }
            });
            
    });
      });

massum left a reply on Pass Data From Ajax To Controller In Laravel

i tried your answer but it gives error 'http://localhost:8000/roombooking?id=12 405 (Method Not Allowed)' what i m doing is i have a view name booking. in that booking page i am using the ajax and sending the data to roombooking view . @Khudadad

massum left a reply on Pass Data From Ajax To Controller In Laravel

can i send the $data to another view... return view ('booking')->('data',$data)

massum started a new conversation Pass Data From Ajax To Controller In Laravel

i am having a problem in sending ajax get request to fetch the data in to the controller. i am sharing my code below plz help javascript $.ajax({ url: 'roombooking', type: "get", data: {id:data}, success: function(response){ // What to do if we succeed if(data == "success") alert(response); } }); route file Route::post('roombooking','[email protected]'); controller file public function roombooking(request $request) { //redirect('pages.roombooking'); //return 'success'; $data= $request->dataval; return $data; // return view ('pages.roombooking') ; //return View::make('pages.roombooking')-with(compact('success')); //return view('pages.roombooking');

}

what i am trying to achieve is the data i am sending through ajax i should be able to access those data and send it to another view