skip to Main Content

difference between two times Laravel Carbon

I want to check difference between two times in Laravel (the day is not needed) Carbon::createFromTimeString($this->debut) ->diffInHours(Carbon::createFromTimeString($this->fin)) if $this->debut = '08:00:00' and $this->fin = '02:00:00' the expected result is 18 but I have 6 How can I get the correct…

VIEW QUESTION

Laravel – how can I return view from another function

Route: Route::controller(PublicController::class)->group(function () { Route::get('/index', 'index')->name('public.index'); }); View: index.blade.php wrong_browser.blade.php In controller, this way is ok: class PublicController extends Controller { public function index(Request $request) { if(is_wrong_browser) return view(public.wrong_browser); return view('public.index'); } } But how can I return view from…

VIEW QUESTION

Grouping a collection IN LARAVEL

I have an array called $customerRecords. I want to group the data in this array by the customer's email. This is the array below $customerRecords = [ { "id": 1, "note": "This is note 1", "customer": [ { "id": 1,…

VIEW QUESTION
Back To Top
Search