Category : laravel-5.7

I run the following code: $crm_code = "Omaewamoshindeiru"; DB::update("UPDATE death_invitation set active = false where crm_code = ‘?’ and active = true and contract_type_id IN (13, 14, 20, 21)",[[$crm_code]]); And I recieve the following error: Illuminate/Database/QueryException with message ‘PHP Notice: Array to string conversion in /var/www/html/api/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 575 (SQL: UPDATE death_invitation set active = ..

Read more

Related to: Fleet cart using middlewares in routes but i can not find any $routemiddleware in project…not even in kernel.php …where can i find it? I have an installation of Laravel 5.7 using FleetCart module on my website. Fleetcart is already handling some (or all? not sure) endpoints; in addition to that I want to ..

Read more

I made the following controller that fills a docx document with values. namespace AppControllersServices; use AppControllersBaseController; use IlluminateSupportFacadesResponse; use PhpOfficePhpWordTemplateProcessor; use PhpOfficePhpWordPhpWord; class Contract extends BaseController { public function getContract() { $file = storage_path()."/contracts/contract.docx"; $tmpFile = storage_path()."/contracts/output.docx"; $template = new TemplateProcessor($file); $template->setValue(‘COMP_NAME’,"LOREM IPSUM INC"); $template->setValue(‘ADDRESS’,"Nowhere Str Tsastikistan"); $template->saveAs($tmpFile); return Response::make("OK"); } } I want the ..

Read more

I’m trying to execute two redirect at the same time, but I don’t know how to display this correctly in Laravel. Laravel 5.7 is used. Here is my code: public function store(Request $request) { $validatedData = $request->validate([ ‘name’ => ‘min:2|max:50’, ‘details’ => ‘nullable|max:255’, ‘image’ => ‘nullable’, ‘tournament_id’ => ‘nullable’, ]); $team = Team::create($validatedData); return redirect() ..

Read more

I am trying to add validation in the controller but it does not work with auth:check. This is the Laravel version 5.7. This is the function store that has a problem with the validation. public function store(Request $request) { $request->validate([ ‘first_name’ => [‘required’|’min:2’|’max:50’] ]); if(Auth::check()){ $player = Player::create([ ‘first_name’ => $request->input(‘fist_name’), ‘last_name’ => $request->input(‘last_name’), ]); ..

Read more

I’m converting my laravel left join query to a relational query I’ve created all the required relations for that. but it’s not returning any data for reference I’m attaching both my queries please suggest what can I do to make it work. Old Query $q = DB::table(‘contracts’) ->select(‘contracts.id’, ‘contracts.contract_start_time’, ‘contract_candidate_schedule.*’, ‘contracts.contract_client_id’,’contracts.contract_candidate_id’, ‘contracts.contract_vacancy_id’, ‘contracts.contract_start_date’, ‘contracts.contract_end_date’, ‘client.client_refno’, ..

Read more

I have a seperate script that sends on a SQS Queue some messages named drifters.php: include ./vendor/autoload.php use AwsSqsSqsClient; $client = new SqsClient([ ‘profile’ => ‘default’, ‘region’ => ‘eu-west-1’, ‘version’ => ‘2012-11-05’ ]); $params = [ ‘DelaySeconds’ => 10, ‘MessageAttributes’ => [ ‘Driver’ => [ ‘mamae’ => ‘Keitchi’, ‘myoji’ => ‘Tsuchiya’, ‘skills’ => [‘drifting’, ‘touge’, ..

Read more

I have a Laravel project which works ok on localhost but on production it throws me this error: file_exists(): open_basedir restriction in effect. File(/home/elias-itsolutions.sk/sub/natura/storage/logs/laravel-2020-10-01.log) is not within the allowed path(s): (/nfsmnt/:/data/:/usr/php73/:/usr/bin/:/apachetmp:/tmp/:/var/tmp/:/dev/urandom:/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/:/usr/local/bin/:/etc/ssl/certs/ca-certificates.crt) Can somebody tell me please how to fix it? Sourc..

Read more

I have a little problem with getting an images from storage. Images are stored in storage/app/public/uploads/files directory. In database they are stored as file name image-1.png … I am getting the files via url generated in Eloquent entity and url looks like src="/uploads/files/image-1.png" But cant see any image. Images are stored manually. Can somebody tell ..

Read more

ps -ef | grep php sudo kill -9 4748 — HERE 4748 is process id from above command Web Sockets – https://docs.beyondco.de/laravel-websockets/1.0/getting-started/introduction.html REF: Pure Roots Project composer require beyondcode/laravel-websockets or “require”: { “beyondcode/laravel-websockets”: “^1.3”, } php artisan vendor:publish –provider=”BeyondCodeLaravelWebSocketsWebSocketsServiceProvider” –tag=”migrations” php artisan migrate php artisan vendor:publish –provider=”BeyondCodeLaravelWebSocketsWebSocketsServiceProvider” –tag=”config” composer require pusher/pusher-php-server “~3.0” npm install npm ..

Read more

I have model Foo with related Bar, with related Baz, in Laravel 5.7 Bar has a latestBaz relationship public function latestBaz { return $this->hasOne(Baz::class)->latest(); } I’m trying to create a scope that will get me all Foos where the latest Baz was more recently updated. So where Foo->updated_at is after Foo->Bar->latestBaz->updated_at I’ve tried passing $this->updated_at ..

Read more

Session is not working after successful Login Authentication and Redirection to this accounts.blade page in Laravel 5.7. Account.blade $id = session(‘nameOfSessionKey’); if (Session::has(‘YOUR_SESSION_KEY’)) { echo ‘do something with session key’; } else { echo ‘session key dosent exist’; //this has been printed after successful redirection on login with custom “admin” guard. } echo “$id”; //no ..

Read more

Basically I have this error after the controller make all it should make, that is, update an property and send an email. I’have tried using the resource route and make my own rout but still sending that status. Frontend code: approveReservation(reservation) { let url = `/api/admin/reservations/${reservation.id}`; axios .put(url, { status: “APPROVED”, reservation }) .then(response => ..

Read more