skip to Main Content

How to use more than 3 implements in laravel model (Laravel Excel)

When I set 3 implementations like below, there was an error: Class AppExportsJobsExport contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MaatwebsiteExcelConcernsWithColumnFormatting::columnFormats). <?php namespace AppExports; use AppModelsJob; use MaatwebsiteExcelConcernsFromCollection; use MaatwebsiteExcelConcernsWithHeadings; use MaatwebsiteExcelConcernsWithColumnFormatting;…

VIEW QUESTION

SQL injection in Laravel 10

I have codes see below which is works. $city = City::find(1); $city->location = DB::raw('geomfromtext('point(' . $location . ')')'); $city->save(); Question 1: Is there SQL injection issue in the codes above because I using DB::raw() which sticking the string(variable) in without…

VIEW QUESTION

Shopify – How to print Api response data as collection

I was trying to print API response data as collection on blade for that i have used following line $customers = collect(json_decode($response, true)); But whenever i tried to print with following code: @foreach($customers as $row) <tr> <td>{{$row->first_name}} {{$row->last_name}}</td> <td>{{$row->email}}</td> <td>{{$row->phone}}</td>…

VIEW QUESTION

Laravel DB::transaction()

I have some code and tried it in two ways. It's not working as expected and is not rolling back data Error produce example is in git : https://github.com/Namvarii/laravel-db-transaction-error DB::beginTransaction(); try { $order = Order::create([ // data ]); $order->notes()->create([ //…

VIEW QUESTION

How to perform RESTfull API post in Laravel

I define a route in my routes/api.php Route::post('Client/LoginClient',[ClientController::class, function(Request $request) { }]); and when I post something to the route, I encounter this error: 419 Page Expired How could I post data to the route? Edit #1: I am posting…

VIEW QUESTION

Get values form dynamic nested arrays in Laravel

I want to get all the values from this array: <root> <Element1> <items> <Element0> <sku>AAAA</sku> </Element0> <Element1> <sku>BBBB</sku> </Element1> </items> </Element1> <items> <Element0> <sku>ABAB</sku> </Element0> </items> <Element2> </Element2> ... ... </root> The array is from Magento2 orders API so its…

VIEW QUESTION

Can't update user on the server but works on localhost using Laravel

I'm working on an api and a lot of it works great, but for some reason I cannot update the members. This is the route: Route::prefix('member')->group(function () { Route::post('login', [AppHttpControllersApiMemberAuthController::class, 'login']); Route::post('register', [AppHttpControllersApiMemberAuthController::class, 'register']); Route::middleware('auth:member_api', 'member.auth.api')->group(function () { Route::get('/', [AppHttpControllersApiMemberAuthController::class,…

VIEW QUESTION
Back To Top
Search