Munch

Experience

3,180

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 28 Lessons Completed
  • 0 Favorites

29th September, 2018

Munch started a new conversation Posting From Vue.js To Laravel • 3 weeks ago

I don't want to completely separate my front and back end by having the back end as an API and consuming it with Vue.js.

Instead I'd like to use Vue components within Laravel blade templates but in certain scenarios like when I POST to login or register a user, I'd like to do that from the Vue.js component using something like AXIOS or Vue Resource.

My question is, does this make my application vulnerable in anyway? I might be over thinking how it works.

Essentially Vue will POST to a route within the web.php file which is grouped my the auth middleware, I'll obviously pass the CSRF token as well. I just want to ensure this is still a good way of going about things before I commit to doing it.

Thanks!

18th August, 2018

Munch left a reply on View Composer • 2 months ago

So in response, the answer was this for me at least:

class JobComposer
{
    protected $job;

    /**
     * JobComposer constructor.
     * @throws \Throwable
     */
    public function __construct()
    {
        $this->job = request()->route('job');
        throw_unless($this->job, new ModelNotFoundException());
    }

    public function compose(View $view)
    {

    }
}

Munch started a new conversation View Composer • 2 months ago

I'd like to use a view composer to determine what button should display on my view. (assume this is a good example as I don't want all this login in my view).

I need to pass to the view composer the current job the view is showing but on construct it seems to instantiate a new job as it has no attributes despite my default one. Any help?

class JobComposer
{
    protected $job;

    public function __construct(Job $job)
    {
        $this->job = $job;
        dd($job);
    }

    public function compose(View $view)
    {

    }
}

16th August, 2018

Munch left a reply on Separated Front End & Git • 2 months ago

Sorry, maybe I could have worded it in another way.

I'd like to use Vue.js and Laravel but I don't like how Vue is done out of the box with Laravel, as in components you use within blade files.

I guess my question would be how to structure it properly?

Munch started a new conversation Separated Front End & Git • 2 months ago

Hello. For my next project, I'd like to use separated Vue.js and Laravel. My question is, what is the best way of structuring this?

In the past, within my Laravel directory, I've ran 'vue init....' to have my Vue project inside. This works ok but can get a little confusing.

Should I have the Vue front end completely outside of the Laravel install? So lets say:

ProjectName/ ProjectName-FrontEnd/ ProjectName-BackEnd/

as an example?

My next question would then be, should these be separated git repositories or is there some git feature I'm unaware of that is useful for a scenario like this.

I'd like to at some point but my project working with CI/CD so whatever suggestion would need to work with this.

Any advice would be much appreciated.

29th July, 2018

Munch started a new conversation Modular And Scalable Apps • 2 months ago

Hey. So I've been trying to find the best way to create modular and scalable Laravel applications. By this I mean, let's say we have a core module, customers can then purchase other modules such as the 'customer dashboard' and let's say another module is 'customer ticket system'.

I'm struggling to find the best way of doing this. I've seen people suggest composer packages which sound good but surely we need to have a bunch of if statements somewhere to say do this if this package is loaded?

Any information would be much appreciated.

16th April, 2018

Munch started a new conversation Docker Worflow/Setup • 6 months ago

Hello everyone. Excuse me if this isn't the correct place to ask.

I don't know why but I've taken quite an interest in trying to learn Docker and get a nice Docker & Gitlab workflow. I only currently work with PHP/LEMP Stack so I'm only interested in learning docker for that first.

My question is, what resources did you use to pick it up? I'm struggling to find resources which work for me and I haven't found any that cover both LEMP Docker and then Gitlab for Laravel to utilise the CI/CD. Please don't provide me with the first result on Google as I've likely tried it. I'd also like my workflow to allow me to switch between my Macbook Pro and Windows 10 machine ideally.

Please also point out if you don't think it's worth learning unless I'm after something very specific. I really not sure why I want to get this workflow down. Thanks

Munch started a new conversation Vue Resource Within A Blade • 6 months ago

Hello everyone. Very new to using Vue and I do not want to have a completely separate Vue to my backend (Laravel). So currently I've been including Vue components within a blade file. My question is if I submit data from the Vue component using something like Vue resource, is it still secure? The route it hits is within my web.php, grouped by the default Laravel auth middleware and still uses the CSRF token.

Hopefully, that makes sense, thanks.

22nd November, 2017

Munch left a reply on Exception Handler Response • 10 months ago

Much appreciated.

Munch started a new conversation Exception Handler Response • 10 months ago

Hello everyone. I'm trying to provide a response to my exception handler when someone isn't authorised to view a page. Currently, I'm just returning a redirect to my home page but I'd like to also add a message. Adding a ->with('error', 'message'); doesn't display my message. Does anyone know how I can provide a message such as the ones displayed when using with or must I make a custom error page? Many thanks.

Edit Your Profile
Update

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