* \Carbon\Carbon::now() // insert current date

* Auth::user()->id // current user id

* if ($request->hasFile(‘bussiness_pan_image’))

* insertGetId // last id of

$id = DB::table(‘posts’)->insertGetId(
array(‘title’ => ‘my post title’, ‘body’ => ‘my post body’)
);
dd($id);

* ‘confirm_password’ => ‘required|same:password’, //for confirm password

* ‘password’ => ‘sometimes|nullable|min:6’, // optional but when filled

* var searchParams = new URLSearchParams(window.location.search);
var checkparam = searchParams.has(‘create_account’);

* @php use \App\Http\Controllers\BusinessController; @endphp // use controller in blade file

$user = DB::table(‘users’)->where(‘name’, ‘John’)->first();

* $pincodecnt=Pincode::count();

* $pincodecnt=Pincode::count();
$pincodes=Pincode::select(‘pincodes.*’,’cy.city_name’,’t.taluka_name’,’d.district_name’,’s.state_name’,’c.country_name’)
->join(‘cities as cy’,’cy.id’,’=’,’pincodes.city_id’)
->join(‘talukas as t’,’t.id’,’=’,’pincodes.taluka_id’)
->join(‘districts as d’,’d.id’,’=’,’pincodes.district_id’)
->join(‘states as s’,’s.id’,’=’,’pincodes.state_id’)
->join(‘countries as c’,’c.id’,’=’,’pincodes.country_id’)->get();

\Session::put(‘userid’,$userid); // set session

session::(‘userid’); //get session

  • DB::table(‘porder_detail’)->where(‘id_order’,$id)->first(); // get object
  • //JOIN QUERY
  • $porders=Porder::select(‘porders.*’,’porder_detail.product_price’,’porder_detail.product_qty’,’mshop_customer.firstname’,’mshop_customer.lastname’,’mshop_customer.email’,’mshop_product.label’,’porder_detail.id_product’)
    ->join(‘porder_detail as porder_detail’,’porders.id’,’=’,’porder_detail.id_order’)
    ->join(‘mshop_product as mshop_product’,’mshop_product.id’,’=’,’porder_detail.id_product’)
    ->join(‘mshop_customer as mshop_customer’,’mshop_customer.id’,’=’,’porders.customer_id’)
    ->where(‘porder_detail.id_order’,$id)
    ->first();
    return $porders;

 

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...