Get last id inserted record to DB in Laravel [duplicate]

This question already has an answer here: Get the Last Inserted Id Using Laravel Eloquent 27 answers I am beginner in Laravel. I use in my project Laravel 5.8. I have this code: $product = new Product(); $product->create([ ‘company_id’ => $request->user()->company_id, ‘enable’ => $request->input(‘enable’) ?? 0, ‘id_delivery_vat’ => $request->input(‘id_delivery_vat’) ?? 1, ‘id_product_vat’ => $request->input(‘id_product_vat’) ??…

Get date from datepicker using Ajax with Laravel controller

i want to get the datepicker value when user selected a date and send that using ajax to a laravel controller. this code is not worked for me.. $.ajaxSetup({ headers: { ‘X-CSRF-TOKEN’: $(‘meta[name=”csrf-token”]’).attr(‘content’) } }); $(‘#date’).datepicker({ format: ‘dd-mm-yyyy’, onSelect: function(date, instance) { $.ajax({ type: “POST”, url: ‘/process_date’, data: date, success: function(result) { console.log(result); } });…

Vue+laravel+apache not redirecting properly

Iḿ trying to run vue+laravel project without php artisan serve but when I acces localhost/project/public I see a blank page with this content only: <head> <link rel=”stylesheet” href=”https://fonts.googleapis.com/css? family=Roboto:100,300,400,500,700,900″><link rel=”stylesheet” href=”https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css”> </head> <body></body> Despite this, when I acces localhost/project/public/any I see my default not found vue page so when I click go home button I…