christiant

christiant

Member Since 3 Months Ago

Experience Points 9,180
Experience Level 2

820 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 90
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

12 Mar
1 week ago

christiant started a new conversation Where To Put Workflow Code

Hi, just recently started to use laravel as a framework and still try to wrap my head around a few things. I want to build a application where I can work von a "case" and push it through a workflow.

What I have so far is the case-model and all relating models (mostly dimensions to the case-model). And from the nice laracast series I already built the maintenance of the dimensions with dedicated controllers and blades for create/update/delete. So far everything nice and simple.

Now comes the part where I have to work on the case. This includes for example that an agent will verify data entered or adds some information, in some states emails will be generated and responses will be entered.

In my "old" world every step had his dedicated php-file and in a very procedural way a form was presented, the agent actions have been handled and after a step was finished the next step (next php-File) started over again. In the database I saved in which step is the current for each case.

I was thinking about taking advantage of https://github.com/brexis/laravel-workflow and I understand how to configure the workflow-configuration, but I still don't have a feeling where to put the actual case processing into.

What I was thinking so far: Everything with a agent-interaction gets views, but would the handling of the triggerd actions (from the views) or saving the input all happen in the CaseController which would lead to a big controller or would I build dedicated controllers for the steps that include the functions "edit" and "store".

I guess that I could use events in transitions, e.g. when I wanted to send out an email notification, but this is just a tiny tasks in the case handling.

I am looking forward to your input

26 Feb
3 weeks ago

christiant left a reply on Using One Form To Save Two Models

I am not so sure what you want me to show you. my current working solution:

public function store(Flightschedule $flightschedule)
      {
        abort_if(\Gate::denies('update', $flightschedule), 403);


       $flightnumber_id = Flightnumber::firstOrCreate($this->validateFlightnumber())->id;

        try {
             Flightschedule::create($this->validateRequest($flightnumber_id));
        }

        catch (\Exception $e) {


            return redirect()->back();
        }

        $this->addflashmsg('success', __('act.FlightscheduleCreated') );

        return redirect('/flightschedule');
      }

the store methode is from the flightschedule-Controller. I first check now, if the flightnumber exists and would store it, return ID. otherwise take the ID of the found row. validateFlightnumber() is currently a copy of the validation of the flightnumber-Controller

So my question is targeting on this row: $flightnumber_id = Flightnumber::firstOrCreate($this->validateFlightnumber())->id;

I am wonding if instead of saving the flightnumber in the Flightschedule-Controller and providing a copy of the validation, would it be wiser to call the FlightnumerController->store function from the FlightnumberController? or would it be better to create a trait with the validation that can be used in both Controllers?

Christian

24 Feb
3 weeks ago

christiant started a new conversation Using One Form To Save Two Models

Hi, I have two models: flightnumber (contains airline, and two airports) and flightschedule (contains flightnumber and departure and arrival date). I have added relationship information to the models.

I have a dedicated controller and form for flightnumber as well, however in the form for flightschedule, the User can enter all the information that is needed by flightnumber and flightschedule.

So in the case, the flightnumber does not yet exist, I would like to create the flightnumber and then create the flightschedule.

It seems I could easily call the two Models by ::create()

But: I don't want to repeat the validation of the request-data for the flightnumber in the flightschedule-Controller.

How can I tell the flightschedule controller to call the flightnumber controller -> store-function? Or do I actually do it in the route? what is the best practise here?

17 Feb
1 month ago

christiant left a reply on JQuery Is Not Loading Into Project

cheers, snapey. thanks for the double load advice.

I am currently in the state to use defer again. I added a section in my layout, at the bottom of the body ´´´ window.onload = function () { @section('footer_js')

        @show
    };
</script>

´´´

and with every blade I want to add js I do this ´´´ @section('footer_js') @parent <new_js_code> @endsection ´´´

From security point it seems the browser-world is in favor of static js-files. however I do not need all the js snippets all the time. I hope at the end of the project I will see if I can refactor and maybe I will have a static js file that I can load (with defer)

christiant left a reply on JQuery Is Not Loading Into Project

So what I found out after a few days of research: defer seems to cause to load the scripts at the end of the loading. and that is after my scripts

<script src="{{ asset('js/app.js') }}" defer></script>

do you not have javascript in the blade-files? is there a better way to do it?

15 Feb
1 month ago

christiant started a new conversation JQuery Is Not Loading Into Project

Hi, I have tried to get jquery working but I am failing. I took the basic laravel installation that includes already bootstrap for the User/Login and just to be sure installed jquery again via npm

I included this in resources/js/app.js ''' //already there: require('./bootstrap'); //new import $ from 'jquery'; window.$ = window.jQuery = $; '''

and in webpack.mix.js this is all there is ''' const mix = require('laravel-mix'); mix.js('resources/js/app.js', 'public/js') .sass('resources/sass/app.scss', 'public/css'); '''

I run npm run dev but I add just like this '''$( document ).ready(function() { console.log( "ready!" ); }); '''

I get following error: $(document).ready(function() $ is not defined I tried $, jQuery, jquery but I seem to oversee something essential.