skip to Main Content

Laravel date->format is not working at whereDate()

$period = new DatePeriod( new DateTime( '2024-03-20 00:00:00' ), new DateInterval('P1D'), new DateTime( '2024-03-28 23:59:59' ) ); $orders = OrderProduct::where ('brand','<>','NULL'); foreach ($period as $date){ $labels[] = $date->format('d-m-Y'); $searchDate = $date->format('Y-m-d'); **//This doesn't work** //$searchDate = '2024-03-26'; **//This works** $order…

VIEW QUESTION

redirect Request to another controller in middleware of laravel

i have a problem with redirect of controller or URL request, i have two api route for example: API No. 1: Route::prefix('v1')->group(function () { Route::controller('handelProController')->group(function () { Route::post('products/all/list', 'getList'); }); }); API No. 2: Route::prefix('v2')->group(function () { Route::controller('anotherProController')->group(function () {…

VIEW QUESTION

Laravel 11 – validated() and related table

I'd like to insert the user-id of the current user into a table in column "user_id". The field is a relation to the user table. Migration / database schema Schema::create('pdlocations', function (Blueprint $table) { $table->id(); $table->timestamps(); $table->decimal('lon', 10, 7); $table->decimal('lat',…

VIEW QUESTION
Back To Top
Search