skip to Main Content

Laravel Timestamp Validation

I want to make sure that the receiving data is a valid timestamp. is there a way to make sure starts_at and expired_at fields are timestamps? $rules = [ 'user_id' => 'required|int|exists:users,id', 'starts_at' => 'required|int|min:1', 'expires_at' => 'required|int|gt:starts_at', ];

VIEW QUESTION

Laravel: How to return view() with ->withInput()

How am I able to return view('support') with following: ->withInput() ->with('success', 'Found results'); Code // if validation do not fail if ($validated->fails() === false) { //session()->flashInput($request->input()); // return return view('siteadmin.support.support', [ 'articles' => $articles, 'categories' => $categories, ]); } Following…

VIEW QUESTION

How to get current month record in laravel?

Need to get record of current month but query return the wrong result.There is only one record in db.but i get wrong count for the current month $data = UserData::select( DB::raw("count(phone) as total") ) ->whereMonth('creation_date', Carbon::now()->month) ->get(); return view('kpidata', compact('data'));…

VIEW QUESTION

Laravel : @include

I'm trying to use @include. But i got this error : Undefined variable: bookOther (View: /home/infinitr/pinus.infinitree.eco/modules/Tour/Views/frontend/guest_list.blade.php) How can i fix it? The Controller : public function guests_list($id){ $booking = Booking::where('id', $id)->first(); $bookOther = BookOther::where('booking_id', '=', $booking->id)->get(); return view('Tour::frontend.guest_list', ['booking'=>$booking, 'bookOther'=>$bookOther,…

VIEW QUESTION

Undefined variable $categories #Laravel

I have this controller <?php namespace AppHttpControllers; use IlluminateHttpRequest; use AppModelsCategory; class CategoriesController extends Controller { public function index() { $categories = Category::all(); return view('home', ['categories'=> $categories]); } } and my blade is something like this(his call "home.blade.php") <link rel="stylesheet"…

VIEW QUESTION
Back To Top
Search