domioanna

Hire Me

Experience

93,190

3 Best Reply Awards

  • Member Since 5 Years Ago
  • 924 Lessons Completed
  • 1 Favorite

30th January, 2018

domioanna left a reply on Switch A Production Site From One Github Repo To Another • 8 months ago

You know what, I never even thought of the @bobbybouwmann, yet it makes perfect sense! Thank you for that. I like the 'new server' idea, then as you say it's just a simple database switch and repointing DNS.

Thank you! :D

domioanna started a new conversation Switch A Production Site From One Github Repo To Another • 8 months ago

I know this isn't specifically a 'Laravel' related question, but this seems like the most reliable place to get a response.

I run a Saas web app that's on a production server, but it was originally built on Laravel 5.2 and I've progressively upgraded as time has gone on.

But as you can imagine, after a few years things are starting to get a little messy in the codebase and also some Laravel elements won't work such as Laravel Mix.

I'm wanting to start from scratch and rebuild the whole system, upgrading things such as Vue (still on v1.0), etc but how would I go about switching over from one Github repo to another?

Everything goes through Forge and Envoyer. Any help or recommendations would be deeply appreciated

2nd September, 2017

domioanna left a reply on Laravel Horizon Not Loading In Production, Showing 'Parse Error' In WaitTimeCalculator.php • 1 year ago

Restarted nginx... seems to have fixed it as it's started working :D

domioanna left a reply on Laravel Horizon Not Loading In Production, Showing 'Parse Error' In WaitTimeCalculator.php • 1 year ago

I have @Hawkleaf, there've been a couple of people having issues locally, which have been fixed by updating PHP or Laravel Valet.

I'll see if anything comes back on Github :)

domioanna started a new conversation Laravel Horizon Not Loading In Production, Showing 'Parse Error' In WaitTimeCalculator.php • 1 year ago

I've installed Laravel Horizon on my application and deployed to production. I've followed all of the instructions and the server is running on PHP version 7.1.8 (using Forge & Envoyer).

When I load Horizon, it shows infinite spinners. Check Dev Tools, it shows an error calling api/stats and api/workload.

When I look at the error I see

FatalThrowableError
Parse error: syntax error, unexpected '='
in WaitTimeCalculator.php (line 75)

This is on line 75 of WaitTimeCalculator.php

[$connection, $queueName] = explode(':', $queue, 2);

Any ideas?

5th January, 2017

domioanna started a new conversation Converting JSON To A CSV File • 1 year ago

Is there a way, in Laravel or via a package, to take a JSON feed and turn it into a CSV file that can be emailed?

I'm trying to streamline and automate areas of my business, so if there is a way that on the first each month to generate and email a CSV file with different data from the website in, that would be amazing.

I know how to do all the other bits, but the conversion of JSON data into a CSV file is the bit I'm struggling with.

21st December, 2016

domioanna left a reply on Global Variable In Controller • 1 year ago

So you could set a session variable like this...

session(['key' => 'value']);

You would set key as the variable name and value as the value you want to retrieve.

Then, to retrieve it elsewhere you would put...

$value = session('key');

You may want to set a default just incase one wasn't set, like this...

$value = session('key', 'default');

Does that make any more sense?

20th December, 2016

domioanna left a reply on Calculate Field Value Before Save • 1 year ago

Are the numbers 1 and 4 saved in a different field in the database?

Could you not dynamically create the image_name whenever that image is called rather than saving it in the database?

Something like:-

$image_name = "img_" . $relationship1->id . "-" $relationship2->id;

Then have this dynamically generated everytime you call an image?

domioanna left a reply on Global Variable In Controller • 1 year ago

Could you not set a session variable?

https://laravel.com/docs/5.3/session#using-the-session

domioanna left a reply on Vim Users... Emmet.vim And <tab> • 1 year ago

This is a Test

domioanna left a reply on Vim Users... Emmet.vim And <tab> • 1 year ago

App/Test

domioanna left a reply on Vim Users... Emmet.vim And <tab> • 1 year ago

return $this;

domioanna left a reply on Has Many Through Relationship / Many To Many Relationship • 1 year ago

Class --< Students >--< Subjects

Class has many Students Student belongs to Class

Student has many Subjects Subject has many Students

For the latter, you're going to need an intermediary table with a 'belongs to many' relationship.

Read https://laravel.com/docs/5.3/eloquent-relationships#many-to-many for more information on this. :)

domioanna left a reply on Has Many Through Relationship / Many To Many Relationship • 1 year ago

Are the Class - Subject related at all?

8th July, 2016

domioanna started a new conversation Vim Users... Emmet.vim And <tab> • 2 years ago

I have Vim set up to use Emmet, and I've set the key to trigger it. Just a pre-requisite, I also have Ultisnips installed.

When I open a HTML or even a .blade.php file to edit from first opening Vim, and insert (as an example) ".test" and hit it does nothing. However, if I open my .vimrc file, write it and close it, then go back and do the same thing in the HTML / blade.php file.... it works!

No idea why, but if anyone else has encountered this or has a set up where they can utilise Emmet without issue I'd be really interested in your help.

18th March, 2016

domioanna left a reply on Envoyer Deployment Failing: Unable To Resolve Github • 2 years ago

Sorry @bashy, what do you mean by 'add another DNS'? How would you set this up?

domioanna started a new conversation Enjoyer Deployment Failing: • 2 years ago

Trying to deploy using Laravel Envoyer, but getting this error.

--2016-03-18 14:10:00--  https://api.github.com/repos/...
Resolving api.github.com (api.github.com)... failed: Name or service not known.
wget: unable to resolve host address ‘api.github.com’
  • I've removed the actual github URL as it had my access token and private repo in it

Any ideas?

6th February, 2016

domioanna started a new conversation Stripe And Invoices • 2 years ago

I'm launching an app next week that uses Laravel, Cashier and Stripe.

I'm also now VAT Registered, and need a way to be able to generate some form of report of all invoices generated and payments taken over a given period.

Does anyone know of any ready-made solutions / CRM that integrated with Stripe and offers this kind of functionality?

I've seen some CRMS systems like Agile that integrate with Stripe but I don't know if they do what I need.

Thanks.

27th January, 2016

domioanna left a reply on Setting Currency In Cashier 6.0 • 2 years ago

Incase anyone else has this same issue, here's how I got around it (thanks to @phroggyy on SlackChat)

I've put this into my AppServiceProvider@boot method.

Cashier::formatCurrencyUsing(function ($amount) {
    $amount = number_format($amount / 100, 2);
            
    if (starts_with($amount, '-')) {
        return '-£ '.ltrim($amount, '-');
    }

    return '£ '.$amount;
});

domioanna started a new conversation Setting Currency In Cashier 6.0 • 2 years ago

I know how to do this in 5.0, but the same code doesn't work in 6.0.

Does anyone know how to change the default "$" / "usd" in Cashier to use "£" / "gbp" without having to edit the core files?

Using:- Larval 5.2 Cashier 6.0

26th January, 2016

domioanna left a reply on L5 Folder Structure Best Practice • 2 years ago

I was looking for a "standard" for this idea, but I think it's more of a project-preference issue. I've made a project where I just put them into a Models folder, but I also have a project where I have different namespaces and a folder for each (as an example, a Posts folder with a model class file for Posts, Comments, Tags, if that makes sense).

If it works for your project, do it.

17th January, 2016

domioanna started a new conversation News On Spark Release? • 2 years ago

I know this question has probably been asked hundreds of times, but I don't suppose anyone has any news on the Spark release date? I don't like to hassle Taylor on Twitter too much as I have a feeling lots of others do and I bet he'll be getting sick of it.

I'm desperate (and for financial reasons, NEED) to release an app and I'm holding off until Spark is released so any news anyone may have would really help.

I apologies to Taylor as I deeply appreciate all of the work he puts in to create someone amazing that allows us all to create these wonderful projects. The things I've been able to do because of Laravel is amazing, things I would have never thought possible, and Spark will open up a whole other world to me to really capitalise!

17th December, 2015

domioanna left a reply on "Watch" Or "Follow" A Conversation • 2 years ago

D'oh! Thanks @bobbybouwmann

domioanna started a new conversation "Watch" Or "Follow" A Conversation • 2 years ago

Sometimes there are conversations or questions asked that I notice and think... "I've had that issue, I'd love to know how the community could fix it". So I leave it for a couple of days and then return to find the outcome, only to realise that I can't find the original conversation...

Or maybe a conversation that has a particular hint or solution that I feel would benefit a project but I'm not at my machine at that time, I seem to lose it when I'm back into that project.

Maybe it's just me, but I think having the ability to add a conversation to a 'Watch" or "Follow" list for later referral, and then whenever there's a reply or a Marked Solution I would receive a notification.

domioanna left a reply on Ajax Delete Function • 2 years ago

If you're not hitting the controller, maybe it's an issue with your routing?

domioanna left a reply on Ajax Delete Function • 2 years ago

Check your Console or Network tab in your Web Inspector for any errors.

10th December, 2015

8th December, 2015

domioanna started a new conversation Broadcast / Emit Event On One Component, Listen On Another • 2 years ago

I have 2 (unrelated) components that are being loaded on one page and I need a method on Component A to broadcast an event which Component B can catch and run it's own logic when it's fired.

Is it possible to use something like this.$broadcast or this.$emit on one component and have another (unrelated) component listen for when it's called?

If so, how?

28th October, 2015

domioanna left a reply on Deployment Failing: Composer\Util\Filesystem::$filesystem • 2 years ago

Never mind, I didn't realise one of the packages I was pulling in was pulling in a 'dev-master' version, which was causing the issue. As soon as I changed to a more stable (actual) version it deployed with no issues.

domioanna started a new conversation Deployment Failing: Composer\Util\Filesystem::$filesystem • 2 years ago

When I deploy through composer I get the following message during the Install Composer Dependencies section...

  - Installing swiftmailer/swiftmailer (v5.4.1)
    Loading from cache

  - Installing jakub-onderka/php-console-color (0.1)
    Loading from cache

  - Installing jakub-onderka/php-console-highlighter (v0.3.2)
    Loading from cache

  - Installing dnoegel/php-xdg-base-dir (0.1)
    Loading from cache

  - Installing psy/psysh (v0.5.2)
    Loading from cache
                                                             
  [ErrorException]                                           
  Undefined property: Composer\Util\Filesystem::$filesystem  
                                                             
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [packages1] ... [packagesN]

Any ideas, or know how to fix it?

15th October, 2015

domioanna left a reply on Eloquent Query To 'merge' / 'join' / 'union' 2 Related Tables • 3 years ago

Built a transformed, worked perfectly! Cheers @pmall

domioanna started a new conversation Eloquent Query To 'merge' / 'join' / 'union' 2 Related Tables • 3 years ago

Let's say I had 2 tables, linked by a one-to-many relationship.

  • Post - belongsTo a user
  • User - hasMany posts

I know I could set up the relationships and call a post with it's owner like so...

$post = Post::with('owner')->first();

...but this returns a collection of the post with the user nested inside of it, like this:-

[
    'id' => 1,
    'user_id => 1,
    'title' => "Some title...",
    'body' => "Some body...",
    'owner' => [
        'id' => 1,
        'username' => "johndoe",
        'email" => "john@example.com"
    ]
]

Is there a way to effectively 'join' or 'merge' those 2 sets of data into one record, so it would look like this...

[
    'id' => 1,
    'title' => "Some title...",
    'body' => "Some body...",
    'username' => "johndoe",
    'email" => "john@example.com"
]

I know there'd be conflicting fields like id, created_at, etc, I would only look to pull across certain fields.

I know this concept is a bit of a backwards way of doing it for this scenario, but for the actual scenario I need it for it will save me a lot of trouble.

Thanks in advance

14th October, 2015

domioanna started a new conversation Larval 5.1 And SSL • 3 years ago

Who do you all use for SSL Certificates, and are there any resources out there that explain how to install them on Laravel, through Forge, hosting with DigitalOcean?

domioanna started a new conversation Amazon S3 Vs Rackspace Vs Local Storage • 3 years ago

I'm building a project that is going to allow users to upload images to records, and I'm looking at 'future-proofing' the site, and I was wondering which people have experience with and which they would recommend in terms of pricing, usability, reliability, etc...

The project will be hosted on DigitalOcean, through Forge, so 'local' storage will be on that hosting package.

6th October, 2015

domioanna left a reply on How To Use Pop-up Modals To Update Records Using Vue-js And Bootstrap Modals ? • 3 years ago

I would also benefit from this... bump!

4th October, 2015

domioanna left a reply on Updating Elixir To 3.3, Error When Running Gulp • 3 years ago

Fixed: upgraded out of date Node / npm

All working. Normal service is now resumed.

Thanks guys.

domioanna left a reply on Updating Elixir To 3.3, Error When Running Gulp • 3 years ago

I've tried that too @ejdelmonico but for some reason it just wont play on mine at all. I wonder if upgrading to El Capitan has had anything to do with it as if has the same issue when I install a brand new Laravel app...

3rd October, 2015

domioanna left a reply on Updating Elixir To 3.3, Error When Running Gulp • 3 years ago

I just uninstall all instances of Laravel Elixir, then installed it, whilst watching the node_module/laravel-elixir folder...

It created all the files for Laravel Elixir, then created a node_modules folder, then proceeded to delete all the other files in laravel-elixir folder except the node_modules folder

domioanna left a reply on Updating Elixir To 3.3, Error When Running Gulp • 3 years ago

Nope, that doesn't work, and now I can't install an earlier version of Laravel Elixir, it just resorts to try install the latest version which dumps out a whole string of errors when trying to install...

domioanna started a new conversation Updating To 3.3, Error When Running Gulp • 3 years ago

After updating package.json to pull in the latest release of Elixir (3.3.1) and running npm install to update, now whenever I run gulp I get the following error

Error: Cannot find module 'laravel-elixir'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/domioanna/Code/spark-test/gulpfile.js:1:76)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

Any ideas?

27th June, 2015

domioanna left a reply on Don't Allow User To Change Others Posts • 3 years ago

If you've set up your relationships you can use something like the following

    $this->user = Auth:user();
$post = $this->user->posts()->findOfFail($post_id);

$post->update( ... array of changes ... );

domioanna started a new conversation Create JSON Key And Value From 2 Form Fields • 3 years ago

I'm utilising the JSON field type in Laravel, but I'm trying to allow the user to fill in a form whereby there would be a row of 2 input fields, whatever they enter in the first field will become the key and the second field would become the value, creating a key => value pair, saving to the database in a JSON format.

Then if the user wants to add another row, they would click a button to add another row.

I don't suppose anyone has any ideas on how I could achieve this?

Using Laravel 5.1, along with Illuminate's HTML / Form facade. Also utilising jQuery if that offers up any solutions.

13th May, 2015

domioanna left a reply on Using ->with() With Constraints, Issue With 'HAVING' • 3 years ago

Thanks @Kryptonit3, @dazzz1er and @JarekTkaczyk!

Each of your comments helped me solve the problem. In the end, I liked the idea of a 'scope' as suggested by @StormShadow, as this give me a nice, simple method to add onto a string of an eloquent call and it works fine.

12th May, 2015

domioanna started a new conversation Using ->with() With Constraints, Issue With 'HAVING' • 3 years ago

This code...

public function getStrategiesWithinDistance($strategy, $postcode, $distance)
    {
        $coords = Postcode::getCoordinates($postcode);
        $lat = $coords['latitude'];
        $lng = $coords['longitude'];

        return $this->user->$strategy()->with([
            'property' => function ($query) use ($lat, $lng, $distance) {
                $query
                    ->selectRaw(
                    '( 3959 * acos(
                            cos( radians( '.$lat.' ))
                            * cos( radians(latitude ) )
                            * cos( radians(longitude ) - radians( '.$lng.' ) )
                            + sin( radians('.$lat.') )
                            * sin( radians( latitude ) )
                        ))
                        AS distance')
                    ->having('distance', '<', $distance)
                    ->select('*');
            }
        ])->get();
    }

...is causing this error...

Illuminate \ Database \ QueryException (42S22)
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'distance' in 'having clause' (SQL: select * from `properties` where `properties`.`deleted_at` is null and `properties`.`id` in (5, 6, 1, 2) having `distance` < 5)

Has anyone attempted to incorporate something like this and succeeded or can anyone see what could be the problem?

As you can probably see from my recent posts, this is something I'm REALLY struggling with.

11th May, 2015

domioanna started a new conversation Incorporating A Eloquent Raw Query Into A Chained Query • 3 years ago

I have a raw query, as follows:-

$results = DB::select(
            DB::raw(
                'SELECT *, ( 3959 * acos( 
                    cos( 
                        radians(' . $lat . ') 
                    ) * cos( 
                        radians( latitude )
                    ) * cos( 
                        radians( longitude ) - radians(
                            ' . $lng . '
                        )
                    ) + sin( 
                        radians(
                            ' . $lat .'
                        )
                    ) * sin( 
                        radians(
                            latitude
                        )
                    )
                ) 
            )
            AS distance FROM properties HAVING distance < ' . $distance . ' ORDER BY distance') );

        return $results;

...which works find for getting ALL properties, but I need to get all of the logged in users properties AND apply a where clause onto a joined table 'strategies'.

Any ideas?

6th May, 2015

domioanna started a new conversation Count On A Polymorphic Relationship With Criteria • 3 years ago

Say I have a Strategy table which has a polymorphic relationship with 3 other tables of Strategy 1, Strategy 2 and Strategy 3.

I need to count how many records there are in just one of the linked tables (i.e. Strategy 2) that match a criteria, i.e. the value of a field is > 150.

I really can't get my head around how to do it.

Any ideas?

Just to give an idea of the relationships...

User HAS MANY Strategies

Strategies HAVE MANY "sub" strategies.

30th April, 2015

domioanna left a reply on Traits And Dependency Injection • 3 years ago

@MarkRedeman After spending a good while on this last night I turned off my Mac, went to sleep. Then in the middle of the night I woke up with the thought of doing it EXACTLY how you've written it! Haha!

So I'll implement that tonight. Thank you.

29th April, 2015

domioanna left a reply on Traits And Dependency Injection • 3 years ago

OK, I've changed it to a Controller extending a BaseController, so the idea is that there'll now be several StrategyControllers that extend the BaseController, but the store() and update() methods on each will need different Request files to be injected into them.

Any ideas how I could achieve this?

domioanna left a reply on Traits And Dependency Injection • 3 years ago

I have a StrategyTrait file which looks like this

trait StrategyTrait {

    protected $name;
    protected $repository;
    protected $createCommand;
    protected $strategyRequest;

    /**
     * Store a newly created resource in storage.
     *
     * @return Response
     */
    public function store(Request $request)
    {
        $this->dispatchFrom(
            $this->getCreateCommand(), $request
        );

        Flash::success('Awesome! You added a new strategy.');

        return redirect('property/' . $request()->get('property_id'));
    }
}

I'm trying to set it so that I can change which Request file is called for validation by defining it in that particular Strategy controller, so for example (I've been using __constructor() to set these, but if you know of a better way, say)...

class SingleletController extends Controller
{
    use StrategyTrait;

    protected $strategyRepository;

    public function __construct(StrategyRepository $strategyRepository)
    {
        parent::__construct();
        $this->middleware('auth');

        $this->setStrategyName('singlelet');
        $this->setRepository($strategyRepository);
        $this->setCreateCommand(CreateSingleletCommand::class);
    }
}

For the Repository and Command it works

domioanna started a new conversation Traits And Dependency Injection • 3 years ago

So, because I've got several Controllers that use the same methods and each of those methods are more or less exact other than a couple of variables on each Controller, I've created a trait and set up getters and setters for each of these variables which are called and set in the __construct() of each Controller.

Now, my question... How do I set the 'Request $request' dependency injection on a method? Each Controller will need it's own request calling but I cannot work out how inject it...

public function store(Request $request)
{
    // Do something amazing...
}

                            
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.