CarlEOgden

CarlEOgden

Member Since 11 Months Ago

Experience Points
1,980
Total
Experience

3,020 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
1,980 XP
Oct
15
5 days ago
Activity icon

Started a new Conversation Laravel Dropbox - Weird Issue When Trying To Download Shown Files

Hi

We integrate our system with Dropbox. One of our clients when shown a list of files from Dropbox cannot download them. When we look at test data as ourselves, similar files are downloaded.

They don't have the login details used to create the API and have forgot or even lost the email that created the API.

Has anyone seen a similar issue and is it due to a dropbox authentication issue and if so, did you have to log into dropbox to fix said issue?

We are currently trying to contact Dropbox for further help but thought I'd ask here!

Regards Carl.

Oct
08
1 week ago
Activity icon

Replied to Multiple Mail Drivers

Hi

This seems to work with app environment variables (a..php),

$value = config('app.timezone');
echo $value;
config(['app.timezone' => 'America/Chicago']);
$value = config('app.timezone');
echo $value;

The above changes 'Europe/London' to 'America/Chicago'

But, the variables I'd like to change are in .env file such as

MAIL_DRIVER=smtp
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=

My idea would be to store all the above in my DB and then get them, if they don't exist, go with the default .env ones otherwise, use the DB values.

Kind regards Carl.

Activity icon

Started a new Conversation Multiple Mail Drivers

Hi

Do you think it is possible to send emails from Laravel from different mail servers?

For example:

Customer 1 has an Exchange Server in their office - could we then login as a mail user and send mail from this server Customer 2 has a Google Mail Business account - could we then login as a mail user and send mail from this server Send daily emails via our local mail server Send other emails by Mailgun Send other emails from another server

Our current setup uses a local server and works fine but want offer other options.

Cheers in advance Carl.

Sep
25
3 weeks ago
Activity icon

Replied to How To Get Last Row From Table From A User

Why don't you order it by desc so the latest entry is the first in your array?

Activity icon

Started a new Conversation Laravel / Spatie / Mailgon Webhooks - Invalid Signature

Hi

Got a puzzling one, we installed laravel-spatie-webhook-client on our Laravel 7 server and have entered out api key in webhook-config.php

'signing_secret' => 'our number in here',

Once we get it working, we'll store this in the .env file and call it as it should be called.

I've managed to create App\Handle\ProcessWebhook.php

<?php
namespace App\Handler;

use \Spatie\WebhookClient\ProcessWebhookJob;

//The class extends "ProcessWebhookJob" class as that is the class //that will handle the job of processing our webhook before we have //access to it.
class ProcessWebhook extends ProcessWebhookJob
{
	public function handle(){
		$data = json_decode($this->webhookCall, true);
		//Do something with the event
		var_dump($data);
		http_response_code(200); //Acknowledge you received the response
	}
}

But everytime I test it from the Mailgun webhooks page to the url I get an exception:

** Message ** The signature is invalid.

** File ** WebhookFailed.php

** Line ** 11

** Request URI ** /webhook-receiving-url

Any idea what I've done wrong?

Cheers Carl.

Sep
24
3 weeks ago
Activity icon

Replied to Laravel Send Mail::send - Can Both Html & Text Be Sent?

Hi

Just to let you know, the variable that is being compated "document", is an array with various fields including the html version of the email in a variable called "letter". I created another array called "text" and did strip_tags($document['letter']) and now when the email is sent, a text version is also sent with it!

Pure luck that I tried this and that it worked!

Thanks for your help Carl.

Activity icon

Replied to Laravel Send Mail::send - Can Both Html & Text Be Sent?

Hi

The actual bit of code that does the current emailing is:-

                    foreach ($email_addresses as $recipient_email_address) {
                        if (filter_var($recipient_email_address, FILTER_VALIDATE_EMAIL)) {
                            Mail::send('emails.letter', compact('subject', 'agent', 'branch', 'document'), function ($message) use ($reply_to, $subject, $agent, $recipient_email_address, $all_attachments) {
                                $message->to($recipient_email_address);
                                $message->from(env('MAIL_FROM_ADDRESS'), $agent->AgencyName);
								$message->subject($subject);
								foreach ($all_attachments as $attachments) {
									$message->attach($attachments);
								}
                                if (filter_var($reply_to, FILTER_VALIDATE_EMAIL)) {
                                    $message->replyTo($reply_to);
                                }
                            });
                        }
                    }
Activity icon

Replied to Laravel Send Mail::send - Can Both Html & Text Be Sent?

Hi

Thanks for that, for some reason my inherited code doesn't accept ->text so will do a bit more digging!

Will mark your answer as solved

Cheers Carl.

Activity icon

Started a new Conversation Laravel Send Mail::send - Can Both Html & Text Be Sent?

Hi

I've got my emails working as HTML but, to reduce on these direct emails being classed as spam, would like to add a text version of the message but it seems this plugin can either do text or html not both!

Or am I missing something?

Cheers Carl.

Sep
21
4 weeks ago
Activity icon

Started a new Conversation Laravel 8 / VueJs / Cannot Find Element: #user-list-template

Hi

I'm just getting a Laravel 8 environment setup on a laptop to play around with things in a controlled environment.

I've used some of the settings in my Laravel 7 dev/live environment to be able to create some templates.

My code is:-

user.blade.php (located in resources/views

@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">{{ __('Dashboard') }}</div>
                    <div class="card-body">
                        <!-- Add new component  -->
                        <user-list></user-list>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

@section('templates')
    @include('templates.user-list')
@endsection

In my user-list-blade.php (located in resources/views/templates) and also where the error is showing from

<template id="user-list-template">
    <div class="card">
        <div class="card-header">
            <div class="card-body">
                <h3>Users</h3>
            </div>
        </div>
    </div>
</template>

In my user-list.js (located in resources/js/components):-

export default {
    name: 'user-list',
    template: '#user-list-template',
    props: {},

    data() {
        return {
            
        };
    },
    created() {
        console.log('i am here - woo hoo!');
    },
}

In my app.js:-

/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */

require('./bootstrap');

window.Vue = require('vue');

/**
 * The following block of code may be used to automatically register your
 * Vue components. It will recursively scan this directory for the Vue
 * components and automatically register them with their "basename".
 *
 * Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
 */

// const files = require.context('./', true, /\.vue$/i)
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))

Vue.component('example-component', require('./components/ExampleComponent.vue').default);

// Below is how templates are currently configured in my working system
Vue.component('user-list', ComponentUserList);
import ComponentUserList from './components/user-list.js';

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

const app = new Vue({
    el: '#app',
});

In the above, my current system uses the two lines Vue.component and import .... and works without error.

When I click on the User blade, I get in the console:-

i am here - woo hoo!
[Vue warn]: Cannot find element: #user-list-template
[Vue warn]: Template element not found or is empty: #user-list-template
[Vue warn]: Failed to mount component: template or render function not defined.

Any idea what I've done wrong.

I have noticed that all examples and tutorials seem to group both laravel and vuejs scripts in the same file, but as my current environment is working as above, I'd at least like to keep the same layout of files/structure etc and get this working.

Thanks in advance Carl.

Sep
14
1 month ago
Activity icon

Awarded Best Reply on Laravel Validator Exception Error

Stumbled across this:

		} catch (\Exception $ex) {
			$messages = $ex->validator->messages();
		} finally {
			return redirect()->back()->withErrors($messages)->withInput();
		}

And that gives me exactly what I want!

Regards Carl.

Activity icon

Replied to Laravel Validator Exception Error

Stumbled across this:

		} catch (\Exception $ex) {
			$messages = $ex->validator->messages();
		} finally {
			return redirect()->back()->withErrors($messages)->withInput();
		}

And that gives me exactly what I want!

Regards Carl.

Activity icon

Replied to Laravel Validator Exception Error

Hi

No I wasn't but I am now, but, I am struggling to do the following:

Highlight the field in error Display a proper error message.

My current code is :-

		try {
			$validator = $this->validate($request, [
				'reference'                 => 'required',
				'office_id'                 => 'required',
				'property_id'               => 'required',
				'agreement_date'            => 'required',
				'let_period'                => 'required',
				'initial_period'            => 'required',
				'start_date'                => 'required|date_format:d/m/Y',
				'end_date'                  => 'required|date_format:d/m/Y|after:start_date',
				'let_price'                 => [
					'required',
					'Regex:/'.config('standout.regex.price').'/',
				],
				'bond_price'                => [
					'required',
					'Regex:/'.config('standout.regex.price').'/',
				],
				'first_payment_due'         => 'required|date_format:d/m/Y',
				'payment_terms'             => 'required',
				'fee'                       => 'required',
				'fee_type'                  => 'required',
				'finders_fee'               => 'required|numeric',
				'diarise_for_and_assign_to' => 'required',
				'gas_start'                 => 'numeric',
				'electricity_low_start'     => 'numeric',
				'electricity_high_start'    => 'numeric',
				'water_start'               => 'numeric',
				'gas_end'                   => 'numeric',
				'electricity_low_end'       => 'numeric',
				'electricity_high_end'      => 'numeric',
				'water_end'                 => 'numeric',
			]);
		} catch (\Exception $ex) {
			$arrResponse = array(
				'result' => 0,
				'reason' => $ex->getMessage(),
				'data' => array(),
				'statusCode' => 404
			);

		} finally {
			return redirect()->back()->withErrors($ex->getMessage())->withInput();
		}

I'd like to be able to highlight "finders_fee" as the one being invalid.

Kind regards Carl.

Activity icon

Started a new Conversation Laravel Validator Exception Error

Hi, I've got the following code:

$this->validate($request, [
'reference'                 => 'required',
'office_id'                 => 'required',
'property_id'               => 'required',
'agreement_date'            => 'required',
'let_period'                => 'required',
'initial_period'            => 'required',
'start_date'                => 'required|date_format:d/m/Y',
'end_date'                  => 'required|date_format:d/m/Y|after:start_date',
'let_price'                 => [
                'required',
                'Regex:/'.config('standout.regex.price').'/',
            ],
'bond_price'                => [
                'required',
                'Regex:/'.config('standout.regex.price').'/',
            ],
'first_payment_due'         => 'required|date_format:d/m/Y',
'payment_terms'             => 'required',
'fee'                       => 'required',
'fee_type'                  => 'required',
'finders_fee'               => 'required',
'diarise_for_and_assign_to' => 'required',
]);

If I change:-

'finders_fee'    => 'required|numeric'

I then get the following exception error:

array:1 [▼
  "e" => Illuminate\Validation\ValidationException {#1047 ▼
    +validator: Illuminate\Validation\Validator {#1053 ▶}
    +response: null
    +status: 422
    +errorBag: "default"
    +redirectTo: null
    #message: "The given data was invalid."
    #code: 0
    #file: "/mnt/storage/standout/public_html/dev/vendor/laravel/framework/src/Illuminate/Validation/Validator.php"
    #line: 445
    trace: {▼
      /mnt/storage/standout/public_html/dev/vendor/laravel/framework/src/Illuminate/Validation/Validator.php:445 {▶}
      /mnt/storage/standout/public_html/dev/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php:47 {▶}
      /mnt/storage/standout/public_html/dev/app/Http/Controllers/AgreementController.php:163 {▼
        App\Http\Controllers\AgreementController->store(Request $request) …
        ›             'finders_fee'               => 'required|numeric',
        ›             'diarise_for_and_assign_to' => 'required',
        › \t\t]);

How do I stop this from happening and return the error?

I'm using Laravel 7

Regards Carl.

Activity icon

Replied to Wanted To Create Family Tree With Vue JS

Hi

This was posted on a Facebook Laravel group a while ago:

https://github.com/modularsoftware/genealogy?fbclid=IwAR00QOfKP8pE_oyAuuEEcBChj8QwQOFgvUFsN6R5tCcm-KUzqQy5TNiW4w4

Not sure if it will help? Regards Carl.

Aug
27
1 month ago
Activity icon

Awarded Best Reply on Adding Name And Value To An Array In VueJS/JS

SOLVED!

To do what I needed to do:-

MyNewArray[index] = {Name: varName, Value: varValue};

And job sorted!

Cheers Carl.

Activity icon

Replied to Adding Name And Value To An Array In VueJS/JS

SOLVED!

To do what I needed to do:-

MyNewArray[index] = {Name: varName, Value: varValue};

And job sorted!

Cheers Carl.

Activity icon

Started a new Conversation Adding Name And Value To An Array In VueJS/JS

Hi

Sorry for another daft question, I have pulled back some data from the db into an array, I want to now create a new array using this data

I have an array like:

Array(9)
0:
AgreementID: (...)
AgreementLink: (...)
AgreementReference: (...)
BaseCurrency: (...)
OutStanding: (...)
PropertyAddress: (...)
PropertyID: (...)
PropertyLink: (...)
PropertyReference: (...)
TenantLink: (...)
TenantName: (...)

What I now want to create:

Array(0)
0:
Name: (...)
Value: (...)

I want to create the Name to be a concatenation of AgreementReference + ' ' + TenantName + ' ' + OutStanding and the Value to be AgreementID

Then with that array, I should be able to populate a select box in my blade.

myNewArray[index].Value = myOriginalArray[index].AgreementID;

Abve doesn't work as I've tried that!

Thanks for any help in advance

Cheers Carl.

Aug
25
1 month ago
Activity icon

Replied to JS NewClass Equivalent

@squiaios

Yes!

Thanks for that, perfect for what I require. I've now got my select working.

Kind regards Carl.

Activity icon

Started a new Conversation JS NewClass Equivalent

Hi

In php, I create variables that will load in the select option as follows:

			$db_header_names = explode(',', 'Date,Type,Account,Description,Debit/Credit,Reference');
			$db_header = [];
			$i = 0;
			foreach($db_header_names as $line) {
				$temp = new \stdClass();
				$temp->Name = $line;
				$temp->Value = $i;
				$db_header[$i] = $temp;
				$i++;
				unset($temp);
			}

This gives me:

  "db_header" => array:6 [▼
    0 => {#1047 ▼
      +"Name": "Date"
      +"Value": 0
    }
    1 => {#1048 ▼
      +"Name": "Type"
      +"Value": 1
    }
    2 => {#1049 ▼
      +"Name": "Account"
      +"Value": 2
    }
    3 => {#1050 ▼
      +"Name": "Description"
      +"Value": 3
    }
    4 => {#1051 ▼
      +"Name": "Debit/Credit"
      +"Value": 4
    }
    5 => {#1052 ▼
      +"Name": "Reference"
      +"Value": 5
    }
  ]

How can I replicate this in VueJS?

Kind regards in advance Carl.

Aug
18
2 months ago
Activity icon

Replied to Location.reload(true) Isn't Reloading Properly

@sunnbeck @davidifranco

Thanks for your help, this code fixed it:

window.location.href = window.location.href;
location.reload(true);

Cheer guys! Carl.

Activity icon

Replied to Location.reload(true) Isn't Reloading Properly

@sinnbeck

Thanks for your reply, I can only answer yes and no! Yes, the form disappears and re-draws (giving the impression of a reload) but No, the new line of data does not appear.

I will comment out the reload, and try your suggestion of doing a console reload after i press the save button!

Regards Carl.

Activity icon

Started a new Conversation Location.reload(true) Isn't Reloading Properly

Hi

I have a js routine in my Laravel app that saves some data to the database using an axios call that is working, however, i need to force a page reload so the data shows in a table. when I call

location.reload(true)

The data doesn't show but if i do a manual reload of the page by clicking it, the data appears in the table.

Any ideas of how to fix this?

Cheers Carl.

Aug
11
2 months ago
Activity icon

Replied to Vuejs/Laravel - Ziggy - Not Routing

Hi

Quick addition

I changed the way I've done it as I didn't like the <button</button option and so in js I have:

In my blade:

<button class="button" @click="printedInvoice()">Print invoice</button>

In js

printedInvoice() {
     window.location = this.invoiceUrl;
}

And that works perfectly!

Cheers again Carl.

Activity icon

Replied to Vuejs/Laravel - Ziggy - Not Routing

Hi Guys,

Thanks for the reply, I've now got this working in different way, in my JS I create:

this.invoiceUrl = route('letter::select', {
	sub_type: this.sub_type,
	property_id: this.property_id,
	payment_id: this.payment_id,
	});

Then, in my blade, I just:

<button class="button"><a class="buttonClass" :href="invoiceUrl">Print Invoice</a></button>

And it changes the screen to be able to then print the invoice.

Thanks very much for all your help

Cheers Carl.

Activity icon

Started a new Conversation Vuejs/Laravel - Ziggy - Not Routing

Hi

I've now got Ziggy installed so that hopefully I can move from the current page I am on, to another.

In my blade I have:

<button type="button" :class="buttonClass" @click="invoicePrinted()">Print invoice</button>

In my js I have:

methods:
		invoicePrinted() {
			return route('letter::select', {
				sub_type: this.sub_type,
				property_id: this.property_id,
				payment_id: this.payment_id,
			}).url;
		},

When I click the button, I was hoping that my page woud then move from where I was to the letter::select page.

However, nothing happens, has anyone any idea what I've done wrong?

Cheers Carl.

Activity icon

Replied to Convert Js Variables To $ Php Variables To Use In Blade

Thank you, will investigate this further.

Cheers Carl.

Activity icon

Replied to Convert Js Variables To $ Php Variables To Use In Blade

Thanks for that! Back to the drawing board then.

Cheers Carl.

Activity icon

Started a new Conversation Convert Js Variables To $ Php Variables To Use In Blade

Hi

My blade calls a js routine to save some invoice data, it returns those variables as:

In vuejs:

this.paymentid this.propertyid this.subtype

Convert to php:

$paymentid $propertyid $subtype

What i need to do (and I can see the js variables exist in my blade as I have div that shows v-if="paymentid > 0") is convert them from js to php.

This is so that I use a button to

{{ route('letter::select', [ 'sub_type => $subtype ]) {{

as I can't use

{{ route('letter:select', [ 'sub_type' => @{{ subtype }} ) }}

Thanks for any help! Cheers Carl.

Jul
29
2 months ago
Activity icon

Started a new Conversation Exporting Calendar Appointments From Laravel To Outlook 365

Hi

I've started research on how to export calendar appointments from Laravel to Outlook 365.

Using Microsoft Graph you need to configure your app in azure (according to the documentation).

However, my system is used by many users and they have their own microsoft account so we are not able to create details details for storing in the env file or linking the app to azure.

Can anyone point me in the direction of an alternative API that can be used easily to send this information, I'd presume I have to authentic my users to their outlook/microsoft account prior but at least this allows users to set it up and then be able to sync our calendar with their outlook!

Cheers in advance Carl.

Jul
22
2 months ago
Activity icon

Replied to Option Selected Being Ignored?

Hi,

Please ignore (don't know how to delete a post)!

I reverted to another way of displaying the select and made vuejs set the value for the dropdown and it's now working!

Cheers Carl.

Jul
21
2 months ago
Activity icon

Started a new Conversation Option Selected Being Ignored?

Hi

I've got a select dropdown that isn't working for the life of me, can anyone spot what I am doing wrong?

To load the data, I've an array built in my controller/helper:

			$provider_value = $advertising_board_details->BoardValue;

			$board_companies = [];

			$board_comps = new \stdClass();
			$board_comps->key = 1;
			$board_comps->value = 'Agency Express';
			$board_companies[] = $board_comps;
			unset($board_comps);
			$board_comps = new \stdClass();
			$board_comps->key = 2;
			$board_comps->value = 'Other';
			$board_companies[] = $board_comps;
			unset($board_comps);

That gives me an array:

$board_companies
	[0]
		key->1
		value->'Agency Express'
	[1]
		key->2
		value->'Other'

$provider_value = 2

In my blade, I have:

<div class="row">
	<so-select label="Board Providers" v-model="company_chosen" class="col-33" name="company_chosen" id ="company_chosen">
		<template #options>
			@foreach($board_companies as $board)
				@if($board->key != $provider_value)
					<option value="{{$board->key}}">{{$board->value}}</option>
				@else
					<option value="{{$board->key}}" selected>{{$board->value}} ({{$board->key}}-{{$provider_value}})</option>
				@endif
			@endforeach
		</template>
	</so-select>
</div>

I've added the $board->key and $provider_value to the end of the label to prove that this code is work, so I get "Agency Express" and "Other (2-2)" so know it does that but on screen, it shows the first option, not the second.

Any ideas what I've done wrong?

Cheers in advance Carl.

Jun
12
4 months ago
Activity icon

Replied to Copying From Dropbox To The Server

Hi

Sorted it by using the dropbox plug in and correctly configuring it, once I'd worked out what the fields need to store!

Cheers Carl. PS Don't know how to delete a post!

Activity icon

Started a new Conversation Copying From Dropbox To The Server

Hi

I've got dropbox working on my system, but i need to take a file from Dropbox, put it into a tmp folder on the server for then attaching to an email.

For the life of me I can't work out how to copy a file!

Can anyone point me in the direction of an example or how to do it in php?

Cheers in advance Carl.

Jun
10
4 months ago
Activity icon

Started a new Conversation Gulp Showing Issue When Saving Blade Files

Hi

I have gulp configured to upload my files that i change, this week I've noticed the following error occurring and can't work out why!

Anyone seen this before and any ideas on how to fix it? It started happening when switching branches in sourcettree, i am now in the branch i need to be and that part is working as normal!

[07:52:34] 'deploy-views' errored after 2 s [07:52:34] Error: Can't open that file: Permission denied at makeError (/Users/user/Git/folder/node_modules/ftp/lib/connection.js:1067:13) at Parser. (/Users/user/Git/folder/node_modules/ftp/lib/connection.js:113:25) at Parser.emit (events.js:200:13) at Parser.EventEmitter.emit (domain.js:494:23) at Parser._write (/Users/user/Git/folder/node_modules/ftp/lib/parser.js:59:10) at doWrite (_stream_writable.js:417:12) at writeOrBuffer (_stream_writable.js:401:5) at Parser.Writable.write (_stream_writable.js:301:11) at Socket.ondata (/Users/user/Git/folder/node_modules/ftp/lib/connection.js:273:20) at Socket.emit (events.js:200:13)

Thanks in advance for any help and/or advice. Carl.

Jun
09
4 months ago
Activity icon

Replied to Validate - Why Can't It Use Null As '' ??

Hi

Thanks for your reply and I will try to explain a bit better!

I have a blade with lots of options and if you leave them blank, when you click Save button and start performing the validation, fields that have no text and have null as their value. When you then perform the validate, all i get is an exception error that reads "The given data is invalid".

If I then remove the fields that are sent over with null, the validate works as expected. So, I then have to write my own validate so that if a field is null, display the error.

For example (on a different form that I have now manually written validations) I have a field called "bedrooms" that is null but has to be an integer > 0 but, when I use $this->validate if bedrooms is null, it will not work so I now manually test for it.

I suspect that as we have jumped from an earlier version to the latest, the way validator has changed and once classed null and '' were the same, are no longer the same!

Cheers Carl.

Jun
08
4 months ago
Activity icon

Replied to Foreach Loop Is Not Working

Hi

You can read your variables if you:

@foreach($projectmachines as $c)
	@dd(get_defined_vars())

So that you can confirm what -> variables exist for $c

Hope this helps Carl.

Activity icon

Started a new Conversation Validate - Why Can't It Use Null As '' ??

Hi

I've worked out that if a field is a null, validate classes it as a data error.

So, if I had this to validate a form:

        $this->validate($request, [
            'title'            => 'nullable|required_without:contractor',
            'first_name'       => 'required_without:contractor',
            'surname'          => 'required_without:contractor',
            'postcode'         => 'required',
            'address'          => 'required',
            'country'          => 'required',
            'email_address'    => 'multi_email|required_with:contractor',
            'tenant'           => 'required_without_all:purchaser,vendor,landlord,solicitor,contractor,rental_guarantor',
            'purchaser'        => 'required_without_all:tenant,vendor,landlord,solicitor,contractor,rental_guarantor',
            'vendor'           => 'required_without_all:tenant,purchaser,landlord,solicitor,contractor,rental_guarantor',
            'landlord'         => 'required_without_all:tenant,purchaser,vendor,solicitor,contractor,rental_guarantor',
            'solicitor'        => 'required_without_all:tenant,purchaser,vendor,landlord,contractor,rental_guarantor',
            'contractor'       => 'required_without_all:tenant,purchaser,vendor,landlord,solicitor,rental_guarantor',
            'rental_guarantor' => 'required_without_all:tenant,purchaser,vendor,landlord,solicitor,contractor',
        ]);

Does this mean that as null's are being sent over, I need to validate it manually now?

Recently updated from Laravel 5.x to 7.x and so working on code improvements!

Regards in advance Carl.

Activity icon

Started a new Conversation Validate Causes Exception Error (after Updating Laravel To Latest Version)

Hi

Can anyone point me in the right direction as it appears that updating our environment to the latest version has changes and not sure why!

In my controller I have:

        // Normalise input
        $input = \PropertyControllerHelpers::normaliseInput($request->except('_token'));

       // Validate submitted data
        $rules = \PropertyControllerHelpers::getValidationRulesForStore($input, $branch);

	$this.valiate($request,$rules)

In my routine to create the rules I have:

		if ($input['contract'] == 'For Sale') {
			$persistent_rules = [
				'property_reference' => "required|max:20|reference:{$input['agency_id']},{$input['property_id']}",
				'date_available'     => 'sometimes|nullable|date_format:d/m/Y',
				'status'             => 'required',
				'town'               => 'required',
				'country'            => 'required',
				'latitude'           => ['Regex:/'.config('standout.regex.latitude').'/'],
				'longitude'          => ['Regex:/'.config('standout.regex.latitude').'/'],
				'contract'           => 'required',
				'property_class'     => 'required',
				'property_type'      => 'required',
				'property_style'     => 'required_if:property_class,Residential',
				'bedrooms'           => 'sometimes|nullable|integer|min:0|required_if:property_class,Residential',
				'bathrooms'          => 'sometimes|nullable|integer|min:0|required_if:property_class,Residential',
				'reception_rooms'    => 'sometimes|nullable|integer|min:0|required_if:property_class,Residential',
				'tenure'             => 'required_if:contract,For Sale',
				'finders_fee'        => ['Regex:/'.config('standout.regex.price').'/'],
				'sale_price'         => ['Regex:/'.config('standout.regex.price').'/'],
				'auction_price'      => ['Regex:/'.config('standout.regex.price').'/'],
				'brief_description'  => 'sometimes|nullable|max:1000',
				'location'           => 'sometimes|nullable|max:1000',
				'vendor_view'        => 'sometimes|nullable|max:1000',
			];
		}

In the pre-upgraded environment (this version is my development server), I just get 3 errors about bedrooms, bathrooms and receiptions rooms being invalid.

The error messages I used to get were:

The bedrooms field is required when property class is Residential. The bathrooms field is required when property class is Residential. The reception rooms field is required when property class is Residential.

Now I get an exception error:

array:1 [▼
  "e" => Illuminate\Validation\ValidationException {#971 ▼
    +validator: Illuminate\Validation\Validator {#970 ▼
      #translator: Illuminate\Translation\Translator {#285 ▶}
      #container: Illuminate\Foundation\Application {#2 ▶}
      #presenceVerifier: Illuminate\Validation\DatabasePresenceVerifier {#286 ▶}
      #failedRules: array:5 [▶]
      #excludeAttributes: []
      #messages: Illuminate\Support\MessageBag {#794 ▼
        #messages: array:5 [▼
          "bedrooms" => array:1 [▼
            0 => "The bedrooms field is required when property class is Residential."
          ]
          "bathrooms" => array:1 [▼
            0 => "The bathrooms field is required when property class is Residential."
          ]
          "reception_rooms" => array:1 [▼
            0 => "The reception rooms field is required when property class is Residential."
          ]
          "sale_price" => array:1 [▼
            0 => "The sale price format is invalid."
          ]
          "auction_price" => array:1 [▼
            0 => "The auction price format is invalid."
          ]
        ]
        #format: ":message"
      }
      #data: array:131 [▶]
      #initialRules: array:24 [▶]
      #rules: array:24 [▶]
      #currentRule: "epc_sensible:0,Residential"
      #implicitAttributes: []
      #implicitAttributesFormatter: null
      #distinctValues: []
      #after: []
      +customMessages: []
      +fallbackMessages: []
      +customAttributes: []
      +customValues: []
      +extensions: array:8 [▶]
      +replacers: []
      #fileRules: array:9 [▶]
      #implicitRules: array:10 [▶]
      #dependentRules: array:21 [▶]
      #excludeRules: array:3 [▶]
      #sizeRules: array:8 [▶]
      #numericRules: array:2 [▶]
      #dotPlaceholder: "FhQaKFk8iCPCebbn"
    }
    +response: null
    +status: 422
    +errorBag: "default"
    +redirectTo: null
    #message: "The given data was invalid."
    #code: 0
    #file: "/mnt/storage/standout/public_html/dev/vendor/laravel/framework/src/Illuminate/Validation/Validator.php"
    #line: 417
    trace: {▶}
  }
]

Sorry for the dumb question but how to do i it to return the errors so the user can fix the issues?

Thanks in advance Carl.

May
28
4 months ago
Activity icon

Started a new Conversation Storage::disk Listing A Directory

Hi

I have the following code:

		$url = \AmazonS3Helpers::getPath('agency',$agency_id,'Media');
		try {
			$exists = \Storage::disk('s3')->exists($url);
		} catch (Exception $e) {
			# An error occurs communicating with S3, for now, assume the image exists
			# $exists = true;
		}

I need to get list all the files in a folder on Amazon S3, I know the above verifies that this folder exists, how do i get a listing back? I can't seem to work out if there is a function to do this!

Kind regards in advance Carl.

May
26
4 months ago
Activity icon

Replied to Select Boxes - Is It Possible For Text Search By Default

Hi

No, works in safari as I've just tried that as well! Oh and Opera works as well.

Probably won't in mobile but as most of our users are working on PCs, I'm not too worried at the moment, would just like to be able to have an easier way of showing an edit box!

Cheers Carl.

May
25
4 months ago
Activity icon

Replied to Select Boxes - Is It Possible For Text Search By Default

In Chrome and in the latest Microsoft Edge (it's in beta and updates regularly) and Firefox developer latest version!

So will presume all browsers!

Cheers Carl.

Activity icon

Started a new Conversation Select Boxes - Is It Possible For Text Search By Default

Hi Guys

Back again to ask dumb questions!

I've got a drop down box I am using for a list of solicitor names, once we populate with many solicitors scrolling up and down to find the one you want is tedious.

Now, I've added a blank line as the first entry called "Please select a solicitor" which has a blank value.

What I have noticed is that if you click it, then press backspace you can then type a part name and are able to search!

Am I able that if there is no value (ie the first option in the list) to have it blank allowing text entry.

I've inherited this system and the code I use to create this select is

@include('partials.input', [
	'id'			=> $sol_id,
	'label'         => 'Solicitor acting for this transaction',
	'type'          => 'select',
	'values'  		=> $agency_solicitors,
	'current_value' => ${'selected_sol_name_' . $loop->index},
	'use_key' 		=> true,
	'key'     		=> 'SolicitorID',
	'content' 		=> 'SolicitorName',
	'help_text'		=> 'To search for a Solicitor, click the above, press backspace and you can then enter your search criteria.<br/>Click Save contact for the information below to be updated.'
])
									])

$sol_id is the unique id $agency_solicitors is the variable used that has the values 'SolicitorID' is the value 'SolicitorName' is the readable name

Thanks for any and all help in advance. Regards Carl.

May
22
4 months ago
Activity icon

Replied to Facebook - Creating An Album

Hi

Thanks for that info, it's now on the back burner!

Cheers Carl.

Activity icon

Started a new Conversation Facebook - Creating An Album

Hi

Sorry if this has been asked before, researching some other posts and their recommended links/reading.

If I wanted to integrate Facebook into our Laravel/Vuejs system, is it difficult?

In simple terms, I'd like to authenticate our user with Facebook and probably their facebook company account/page (not sure which but open to suggestions), then I'd like to be able to create (at the press of a button) an album with a title, description and drop a load of photos into it. Then, I'd like to be able to delete said album (at the press of a button)

Thanks for any and all help in advance Carl.

May
14
5 months ago
Activity icon

Replied to How To Build Sql Query Automatically According To The Use Request?

@ptl

Why don't you use stored procedures on your database?

Pass the fields to the stored procedure and you'll be returned with the data?

I've inherited my system to maintain and we do as much as possible in stored procedures and very rarely use a direct db call.

Regards Carl.

Activity icon

Started a new Conversation Identifying The Associated Js File

Hi

New to this, 6 months into modifying an existing laravel/vuejs site.

Whilst I've managed to work my way around the system, once thing puzzles me, how can i easily find which js file is being called?

I know that in my environment, when I create a new template and use the commands, I can then add them to application.js and set a component up, but am struggling to identify (quickly) if it is using a legacy js file.

Is there an easy way to find this out?

Cheers for any and all help and advice! Carl.