Hi i’ve a problem with laravel authentication system (5.8) The problem is that I need to login two times to enter my site My routes file is Route::get(‘/’, ‘[email protected]’); Route::get(‘/polizza’, ‘[email protected]’)->name(‘polizza’); Auth::routes(); ————–other routes—————— RefundsController public function __construct() { $this->middleware(‘auth’); } public function index(){ return view(‘auth.login’); } public function indexRefunds(Request $request){ DB::enableQueryLog(); $grafici = 1; ..

Read more

I am creating an API with Laravel 8. I want to return a Model Tool Collection ToolCollection.php public function toArray ($ request) { return [ ‘status’ => 200, ‘message’ => null, ‘data’ => $ this-> collection ]; } This is the format I have at the moment: { …, "data": { …, "tags": [ {"title": ..

Read more

I’m having to pass search filters in links in my laravel app on various occasions. The following statement was working fine in laravel 4, but now I’m converting it to laravel 8 and its giving me error now. {{ link_to_route(‘workprocess.edit’, ‘Edit Work Process’, array($workprocess->id, json_encode($searchFilters)), array(‘class’ => ‘btn btn-sm btn-warning’)) }} Error Missing required parameters ..

Read more

would someone help me out? I’m trying to update composer, but I get this error saying Your requirements could not be resolved to an installable set of packages. Problem 1 – fxp/composer-asset-plugin[dev-master, v1.3.0, …, v1.4.6] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint. – fxp/composer-asset-plugin 1.4.x-dev is an alias of ..

Read more

select * FROM (SELECT o.customerID,o.slot,o.Mobile,o.orderNumber as orderNumber,o.Name, o.acknowledge_status,o.customerAddress, o.srType,s.startTime,s.endTime,DATE_FORMAT(r.roasterDate, ‘%d-%m-%Y’)AS roasteDate,tlo.name as oltname,o.portId,o.slaClock ,dop.podName,st.statusFFA as srStatus from order o LEFT JOIN slot s ON s.slotId=o.slotId Left join roast r ON o.roasterId=r.roasterId LEFT JOIN engins e ON o.pengId=e.userId LEFT JOIN tlo ON tlo.deviceId=o.deviceId LEFT JOIN dop on dop.podCode=tlo.podCode LEFT JOIN transition_status st ON st.statusReasonCRM=o.srStatus AND o.acknowledge_status=st.orderTransition ..

Read more

This is how I get my values now. But I need this to be updated anytime somebody updates it on firebase without needing to refresh myself. Any idea how to do it with php or with js? function indexmeniu() { $factory = (new Factory)->withServiceAccount(__DIR__ . ‘/aha-bistro-firebase-adminsdk-mdiy7-c7a612b025.json’); $database = $factory->createDatabase(); $category = $database->getReference(‘produse/categorii’)->getValue(); return view(‘meniu’, compact(‘category’)); ..

Read more

Server ENV PHP 7.4 maatwebsite/excel 3.1 I try to use queue import related to https://docs.laravel-excel.com/3.1/imports/queued.html but i got [2020-10-25 01:18:56][16] Failed: MaatwebsiteExcelJobsReadChunk On my working queue all time. public function import(Request $request){ if (Auth::guard(‘web’)->user()->hasRole(‘Collector’)){ return abort(‘404’); } try { Excel::queueImport(new CustomerImport(),$request->file(‘import_file’)); return back()->with(‘success’,’Upload Success’); } catch (Exception $exception) { return back()->with(‘danger’,’An Error when uploading file. ..

Read more

I connect to an external API, using postman the results come within 200-600ms. When i consume the API with my laravel APP, i cannot see this speed, the TTFB is to high. How can i reduce the TTFB ? My application use data from the API to populate form data, like select boxes, so this ..

Read more

Below query is returning 15 results. I want to get the position of a particular record on basis of Id or by order_by. In this order_by column is auto generated string. $reservoirNews = News::whereDoesntHave(‘newsletter’, function($query) use ($newsletterId){ $query->where(‘newsletter_id’,$newsletterId); })->whereDoesntHave(‘letterSentOn’) ->where(‘status’,’=’,’validated’)->orderBy(‘order_by’,’desc’)->get(); It would be a great help for me. Thanks in Advance. Sourc..

Read more

if (isset($user->id)) { if ($user->user_role[0]->role != $usertype) { return redirect()->route(‘view’ . ucfirst($user->user_role[0]->role), [‘id’ => $id]); } $city = City::where(‘name’, $user->city)->first(); $blockReason = BlockReason::where(‘user_id’, $user->id)->orderBy(‘created_at’, ‘desc’)->limit(1)->first(); return view(‘users.view’, compact(‘user’, ‘city’, ‘blockReason’, ‘otherDocs’, ‘type’)); } else { $request->session()->flash(‘error’, ‘Invalid Data’); return redirect()->route($usertype . ‘s’); } } else { $request->session()->flash(‘error’, ‘Invalid Data’); return redirect()->route($usertype . ‘s’); "compact(): Undefined ..

Read more

I am using this wavesurfer inside a @foreach loop in laravel view. But it shows only one time and that is it. <div id="waveform" style="width: 300px;margin-bottom: -20px;margin-top: -60px;"></div> var audio = document.getElementById("audio").value; var wavesurfer = WaveSurfer.create({ container: document.querySelector(‘#waveform’), waveColor: ‘grey’, progressColor: ‘grey’, barHeight: 0.5, responsive: true, }); wavesurfer.on(‘click’, function() { wavesurfer.play(); }); wavesurfer.load(‘/musicfile/Sleep Away.mp3’); var ..

Read more

How to create array in array in easiest way better if use 1 query and get the output array in array This is my query to get coordinates y and x $get_coordinate_y = Location:: select(‘middle_point_y’) ->where(‘id_loc’, $id_loc) ->pluck(‘middle_point_y’); //output: [20,30,55] $get_coordinate_x = Location:: select(‘middle_point_x’) ->where(‘id_loc’, $id_loc) ->pluck(‘middle_point_x’); //output: [45,50,76] From 2 queries above I’ve 2 ..

Read more

I trigger the function with this code, & I want to store it on the backend <a wire:click="updateShow({{$counter->id}})" class="text-warning "> <i class="fas fa-edit"></i> </a> backend livewire file public $counterNumber, $types, $cId, $dataC; public function updateShow($c) { $this->$dataC = Counter::find($c)->first(); $this->dispatchBrowserEvent(‘updateShow’); } but I get follow error: Undefined variable: dataC what am I doing wrong? Source: ..

Read more

I am trying to follow what is written on the official Library https://github.com/unsplash/unsplash-php. All i was able to do up untill now is the installation but i am pretty lost after that. For starters i think i need to add my credential keys which i have but i don’t know where to do that. Requesting ..

Read more