artisticre

artisticre

Member Since 1 Year Ago

Experience Points 3,910
Experience Level 1

1,090 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 20
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.

15 May
4 days ago

artisticre left a reply on Phone Format

How do I marked it solved?

artisticre left a reply on Phone Format

That worked perfectly. Thank you so much

artisticre left a reply on Phone Format

I have this code that is working from another table but not sure how to apply it with {{Auth::user()->phone}}. I am displaying the phonenumber from the user table but the format I want is (xxx)-xxx-xxxx but is is listing as xxxxxxxxxx

   public function formatPhoneNumber($phone) {

    $ac = substr($phone, 1,3);
    $prefix = substr($phone,4,3);
    $suffix = substr($phone, 7);

    return "({$ac}) {$prefix}-{$suffix}";
}

 public function index()
             {
              $admin_applist = DB::table('employmentapplication')
             ->select('id','Fname', 'Lname', 'phone', 'email')
             ->get();

             foreach($admin_applist as $item){
                 $item->phone = $this->formatPhoneNumber($item->phone);
             }


              return view('/admin')->with(compact('admin_applist'));
             }


artisticre started a new conversation Phone Format

I am pulling from the user table with {{Auth::user()->phone}} but I want to format the phone number so it doesn't look like one long string. How can I do this?

14 May
5 days ago

artisticre left a reply on What's Wrong With This?

Well should I move one to a different controller? When the user logs in there is a profile section that shows the user info, name, email, phone. There is also a section on the home page that either lists the application they fill out or has a button for the application if they haven't filled it out. Both land on the home.blade.php view. Not sure how to fix this

artisticre left a reply on What's Wrong With This?

should I not?

artisticre left a reply on What's Wrong With This?

If I do /home and /home1 its hard do to do that. I want both to point to home.blade.php. Maybe I am not doing the routes correctly?

artisticre left a reply on What's Wrong With This?

So I am confused on how to fix this then? Do I change the route and if so how?

Here is the code for dashboard

public function dashboard()
  {
    $userID = Auth::user()->id;
    //  return view('admin');
    $reg_pairs = DB::table('employmentapplication')
    ->join('users', 'employmentapplication.userID', '=', 'users.id')
    ->select('employmentapplication.id as E_id',
         'employmentapplication.Fname as fname',
         'employmentapplication.LName as lname',
         'employmentapplication.phone as phone'
         )
         ->where('employmentapplication.id', '=',$userID)
    ->get();

    // return view('manage.dashboard');
    return view('home')->with(compact('reg_pairs'));
}

And here is the code for index

public function index()
  {
    $user_id = Auth::user()->id;
   $profilelist = DB::table('users')
  ->select('id','name', 'phone', 'email')
  ->get();

  foreach($profilelist as $item){
      $item->phone = $this->formatPhoneNumber($item->phone);
  }


   return view('/home')->with(compact('profilelist'));
  }

artisticre left a reply on What's Wrong With This?

Route::group(array('middleware' => 'auth'), function() { Route::get('/home', '[email protected]')->name('home'); Route::get('/home', '[email protected]');

});

artisticre left a reply on What's Wrong With This?

on the view when I go to /home after login

artisticre left a reply on What's Wrong With This?

Like this? Same error on the view

public function index()
  {
    $userID = Auth::user()->id;
   $profilelist = DB::table('users')
  ->select('id','name', 'phone', 'email')
  ->where('id' '=' $userID)
  ->get()
  ->first();


 dd($profilelist);
   return view('/home')->with(compact('profilelist'));
  }

artisticre left a reply on What's Wrong With This?

@GOATSHARK - I took the phone formatting out and still get the same error:

public function index()
  {
    $userID = Auth::user()->id;
   $profilelist = DB::table('users')
  ->select('id','name', 'phone', 'email')
  ->where('id' '=' $userID)
  ->get();
   return view('/home')->with(compact('profilelist'));
  }

artisticre started a new conversation What's Wrong With This?

I have a function that isn't working but cannot find it I get this error Undefined variable: profilelist

public function formatPhoneNumber($phone) {

 $ac = substr($phone, 1,3);
 $prefix = substr($phone,4,3);
 $suffix = substr($phone, 7);

 return "({$ac}) {$prefix}-{$suffix}";
}

public function index()
  {
    $userID = Auth::user()->id;
   $profilelist = DB::table('users')
  ->select('id','name', 'phone', 'email')
  ->where('id' '=' $userID)
  ->get()
  ->first();

  foreach($profilelist as $profile){
      $profile->phone = $this->formatPhoneNumber($profile->phone);
  }


   return view('/home')->with(compact($profilelist));
  }

And on the blade I have

@foreach($profilelist as $u)
{{$u->name}} {{$u->phone}} - {{$u->email}}
@endforeach

artisticre started a new conversation Print List Of Logged In Users

I have a table that lists the users in the user table. I want to know if its possible to put some logic in searching if they are logged in or not?

13 May
6 days ago

artisticre left a reply on Relationship Help Please

@BOBBYBOUWMANN - I am using Laravel. I have an employment application where the user logs in and fills out the application and submits. Right now I have a very large insert statement(see below) and someone suggested I change to multiple tables with relationships. Not sure how to do this. I made Models for each section of my application but not sure where to go from there?

function insert(Request $req)
    {
    /**
    *Personal Information Insert
    */
      $position = $req->input('position');
      $referred = $req->input('referred');
      $Fname = $req->input('Fname');
      $Lname = $req->input('Lname');
      $socialsecurity = $req->input('socialsecurity');
      $address = $req->input('address');
      $city = $req->input('city');
      $state = $req->input('state');
      $zipcode = $req->input('zipcode');
      $email = $req->input('email');
      $phone = $req->input('phone');
      $startdate = $req->input('startdate');
      $salary = $req->input('salary');
      $uscitizen = $req->input('uscitizen');
      $workpapers = $req->input('workpapers');
      $employmenttype = $req->input('employmenttype');
      $conviction = $req->input('conviction');
      $crimedescription = $req->input('crimedescription');
      $driverslicense = $req->input('driverslicense');
      $stateissued = $req->input('stateissued');
      $currentemployment = $req->input('currentemployment');
      $employmentyes = $req->input('employmentyes');
      $employmentno = $req->input('employmentno');
      $sundaytime = $req->input('sundaytime');
      $mondaytime = $req->input('mondaytime');
      $tuesdaytime = $req->input('tuesdaytime');
      $wednesdaytime = $req->input('wednesdaytime');
      $thursdaytime = $req->input('thursdaytime');
      $fridaytime = $req->input('fridaytime');
      $saturdaytime = $req->input('saturdaytime');
      $graves = $req->input('graves');
      $yesobligations = $req->input('yesobligations');
      // $noobligations = $req->input('noobligations');
      $previousworked = $req->input('previosworked');
      $yespreviousworked = $req->input('yespreviousworked');
      $datesemployed = $req->input('datesemployed');
      $datesemployedreasonforleaving = $req->input('datesemployedreasonforleaving');

      /**
      *Education Information Insert
      */
      $highschoolname = $req->input('highschoolname');
      $highschooladdress = $req->input('highschooladdress');
      $highschoolyearscompleted = $req->input('highschoolyearscompleted');
      $highschoolgraduate = $req->input('highschoolgraduate');
      $highschoolmajor = $req->input('highschoolmajor');
      $highschoolgpa = $req->input('highschoolgpa');

      $universityname = $req->input('universityname');
      $universityaddress = $req->input('universityaddress');
      $universityyearscompleted = $req->input('universityyearscompleted');
      $universitygraduate = $req->input('universitygraduate');
      $universitymajor = $req->input('universitymajor');
      $universitygpa = $req->input('universitygpa');

      $technicalname = $req->input('technicalname');
      $technicaladdress = $req->input('technicaladdress');
      $technicalyearscompleted = $req->input('technicalyearscompleted');
      $technicalgraduate = $req->input('technicalgraduate');
      $technicalmajor = $req->input('technicalmajor');
      $technicalgpa = $req->input('technicalgpa');

      $certifications = $req->input('certifications');
      /**
      *Reference Information Inert
      */
      $reference1name = $req->input('reference1name');
      $reference1phone = $req->input('reference1phone');
      $reference1yearsknown = $req->input('reference1yearsknown');
      $reference1address = $req->input('reference1address');
      $reference1city = $req->input('reference1city');
      $reference1state = $req->input('reference1state');
      $reference1zipcode = $req->input('reference1zipcode');

      $reference2name = $req->input('reference2name');
      $reference2phone = $req->input('reference2phone');
      $reference2yearsknown = $req->input('reference2yearsknown');
      $reference2address = $req->input('reference2address');
      $reference2city = $req->input('reference2city');
      $reference2state = $req->input('reference2state');
      $reference2zipcode = $req->input('reference2zipcode');

      $reference3name = $req->input('reference3name');
      $reference3phone = $req->input('reference3phone');
      $reference3yearsknown = $req->input('reference3yearsknown');
      $reference3address = $req->input('reference3address');
      $reference3city = $req->input('reference3city');
      $reference3state = $req->input('reference3state');
      $reference3zipcode = $req->input('reference3zipcode');
      /**
      *Employment Information Inert
      */
      $employment1startdate = $req->input('employment1startdate');
      $employment1enddate = $req->input('employment1enddate');
      $employment1companyname = $req->input('employment1companyname');
      $employment1startsalary = $req->input('employment1startsalary');
      $employment1endsalary = $req->input('employment1endsalary');
      $employment1reasonleave = $req->input('employment1reasonleave');
      $employment1contact = $req->input('employment1contact');
      $employment1positionsheld = $req->input('employment1positionsheld');
      $employment1companyaddress = $req->input('employment1companyaddress');
      $employment1phone = $req->input('employment1phone');
      $employment1supervisor = $req->input('employment1supervisor');
      $employment1description = $req->input('employment1description');

      $employment2startdate = $req->input('employment2startdate');
      $employment2enddate = $req->input('employment2enddate');
      $employment2companyname = $req->input('employment2companyname');
      $employment2startsalary = $req->input('employment2startsalary');
      $employment2endsalary = $req->input('employment2endsalary');
      $employment2reasonleave = $req->input('employment2reasonleave');
      $employment2contact = $req->input('employment2contact');
      $employment2positionsheld = $req->input('employment2positionsheld');
      $employment2companyaddress = $req->input('employment2companyaddress');
      $employment2phone = $req->input('employment2phone');
      $employment2supervisor = $req->input('employment2supervisor');
      $employment2description = $req->input('employment2description');

      $employment3startdate = $req->input('employment3startdate');
      $employment3enddate = $req->input('employment3enddate');
      $employment3companyname = $req->input('employment3companyname');
      $employment3startsalary = $req->input('employment3startsalary');
      $employment3endsalary = $req->input('employment3endsalary');
      $employment3reasonleave = $req->input('employment3reasonleave');
      $employment3contact = $req->input('employment3contact');
      $employment3positionsheld = $req->input('employment3positionsheld');
      $employment3companyaddress = $req->input('employment3companyaddress');
      $employment3phone = $req->input('employment3phone');
      $employment3supervisor = $req->input('employment3supervisor');
      $employment3description = $req->input('employment3description');

      $applicantsignature = $req->input('applicantsignature');
      $datesigned = $req->input('datesigned');
      $userID = Auth::user()->id;

      $data = array(

        'position'=>$position,
        'referred'=>$referred,
        'Fname'=>$Fname,
        'Lname'=>$Lname,
        'socialsecurity'=>$socialsecurity,
        'address'=>$address,
        'city'=>$city,
        'state'=>$state,
        'zipcode'=>$zipcode,
        'phone'=>$phone,
        'email'=>$email,
        'startdate'=>$startdate,
        'salary'=>$salary,
        'uscitizen'=>$uscitizen,
        'workpapers'=>$workpapers,
        'employmenttype'=>$employmenttype,
        'conviction'=>$conviction,
        'crimedescription'=>$crimedescription,
        'currentemployment' => $currentemployment,
        'employmentyes' => $employmentyes,
        'employmentno' => $employmentno,
        'sundaytime' => $sundaytime,
        'mondaytime' => $mondaytime,
        'tuesdaytime' => $tuesdaytime,
        'wednesdaytime' => $wednesdaytime,
        'thursdaytime' => $thursdaytime,
        'fridaytime' => $fridaytime,
        'saturdaytime' => $saturdaytime,
        'graves' => $graves,
        'yesobligations' => $yesobligations,
        // 'noobligations' => $noobligations,
        'previousworked' => $previousworked,
        'yespreviousworked' =>    $yespreviousworked,
        'datesemployed' =>    $datesemployed,
        'datesemployedreasonforleaving' => $datesemployedreasonforleaving,

        'driverslicense'=>$driverslicense,
        'stateissued'=>$stateissued,

        'highschoolname'=>$highschoolname,
        'highschooladdress'=>$highschooladdress,
        'highschoolyearscompleted'=>$highschoolyearscompleted,
        'highschoolgraduate'=>$highschoolgraduate,
        'highschoolmajor'=>$highschoolmajor,
        'highschoolgpa'=>$highschoolgpa,

        'certifications' => $certifications,

        'universityname'=>$universityname,
        'universityaddress'=>$universityaddress,
        'universityyearscompleted'=>$universityyearscompleted,
        'universitygraduate'=>$universitygraduate,
        'universitymajor'=>$universitymajor,
        'universitygpa'=>$universitygpa,

        'technicalname'=>$technicalname,
        'technicaladdress'=>$technicaladdress,
        'technicalyearscompleted'=>$technicalyearscompleted,
        'technicalgraduate'=>$technicalgraduate,
        'technicalmajor'=>$technicalmajor,
        'technicalgpa'=>$technicalgpa,

        'reference1name'=>$reference1name,
        'reference1phone'=>$reference1phone,
        'reference1yearsknown'=>$reference1yearsknown,
        'reference1address'=>$reference1address,
        'reference1city'=>$reference1city,
        'reference1state'=>$reference1state,
        'reference1zipcode'=>$reference1zipcode,

        'reference2name'=>$reference2name,
        'reference2phone'=>$reference2phone,
        'reference2yearsknown'=>$reference2yearsknown,
        'reference2address'=>$reference2address,
        'reference2city'=>$reference2city,
        'reference2state'=>$reference2state,
        'reference2zipcode'=>$reference2zipcode,

        'reference3name'=>$reference3name,
        'reference3phone'=>$reference3phone,
        'reference3yearsknown'=>$reference3yearsknown,
        'reference3address'=>$reference3address,
        'reference3city'=>$reference3city,
        'reference3state'=>$reference3state,
        'reference3zipcode'=>$reference3zipcode,

        'employment1startdate'=>$employment1startdate,
        'employment1enddate'=>$employment1enddate,
        'employment1companyname'=>$employment1companyname,
        'employment1startsalary'=>$employment1startsalary,
        'employment1endsalary'=>$employment1endsalary,
        'employment1reasonleave'=>$employment1reasonleave,
        'employment1contact'=>$employment1contact,
        'employment1positionsheld'=>$employment1positionsheld,
        'employment1companyaddress'=>$employment1companyaddress,
        'employment1phone'=>$employment1phone,
        'employment1supervisor'=>$employment1supervisor,
        'employment1description'=>$employment1description,

        'employment2startdate'=>$employment2startdate,
        'employment2enddate'=>$employment2enddate,
        'employment2companyname'=>$employment2companyname,
        'employment2startsalary'=>$employment2startsalary,
        'employment2endsalary'=>$employment2endsalary,
        'employment2reasonleave'=>$employment2reasonleave,
        'employment2contact'=>$employment2contact,
        'employment2positionsheld'=>$employment2positionsheld,
        'employment2companyaddress'=>$employment2companyaddress,
        'employment2phone'=>$employment2phone,
        'employment2supervisor'=>$employment2supervisor,
        'employment2description'=>$employment2description,

        'employment3startdate'=>$employment3startdate,
        'employment3enddate'=>$employment3enddate,
        'employment3companyname'=>$employment3companyname,
        'employment3startsalary'=>$employment3startsalary,
        'employment3endsalary'=>$employment3endsalary,
        'employment3reasonleave'=>$employment3reasonleave,
        'employment3contact'=>$employment3contact,
        'employment3positionsheld'=>$employment3positionsheld,
        'employment3companyaddress'=>$employment3companyaddress,
        'employment3phone'=>$employment3phone,
        'employment3supervisor'=>$employment3supervisor,
        'employment3description'=>$employment3description,

        'applicantsignature'=>$applicantsignature,
        'datesigned'=>$datesigned,
        'userID'=>$userID,
      );

   $id = DB::table('employmentapplication')->insertGetId($data);
   return redirect("application/employmentsuccess/{$id}");

    }

artisticre started a new conversation Relationship Help Please

Here is my database relationship. I am not sure this is the best way to do this but its all I understand at this point. I have one large table and one large insert which I am trying to change to several tables and clean up the insert statement. Can anyone help me get started with the insert statement?

10 May
1 week ago

artisticre left a reply on Some Help With Relationships

So what I have done in the User Model I added:

public function personal()
    {
      return $this->hasMany('App\Personal');
    }

    public function employmenttype()
    {
      return $this->hasMany('App\Employmenttype');
    }

    public function education()
    {
      return $this->hasMany('App\Education');
    }

    public function references()
    {
      return $this->hasMany('App\References');
    }

    public function employmenthistory()
    {
      return $this->hasMany('App\Employmenthistory');
    }

    public function acknowledgement()
    {
      return $this->hasMany('App\Acknowledgement');
    }

In each of the models I added:

public function user()
    {
      return $this->belongsT0('App\User');
    }

artisticre left a reply on Some Help With Relationships

Can I just put all the relationships in the User Model? Do I put anything in the other models?

artisticre left a reply on Some Help With Relationships

@DCHUBB - I created an Empapp Model. So you are saying all my code I posted here goes in this model?

artisticre started a new conversation Some Help With Relationships

I am trying to breakup a long insert statement I had by making 5 separate Models. I broke them up by sections of an employment application. The user can only have one application. Question 1 is do I add the relationships like the following and where do I put them?

public function employmenttype() {
        return $this->hasOne('Employmenttype'); // this matches the Eloquent model
    }

    public function education() {
          return $this->hasOne('Education'); // this matches the Eloquent model
      }
      public function references() {
          return $this->hasOne('References'); // this matches the Eloquent model
      }
      public function employmenthistory() {
        return $this->hasOne('Employmenthistory'); // this matches the Eloquent model
    }
    public function acknowledgement() {
        return $this->hasOne('Acknowledgement'); // this matches the Eloquent model
    }
02 May
2 weeks ago

artisticre left a reply on Eloquent Coding

@JLRDW - Its for an employment application.

artisticre started a new conversation Eloquent Coding

I am trying to clean up my code with more eloquent coding. Can someone show me how to make the following code more eloquent?

   function applicationreportprint (Request $request)
                  {
                      $reportprint_id = $request->query('id');
                      $reportprint_data = DB::table('employmentapplication')

                      ->select(
                        'position',
                        'referred',
                        'Fname',
                        'Mname',
                        'Lname',
                        'socialsecurity',
                        'address',
                        'city',
                        'state',
                        'zipcode',
                        'email',
                        'phone',
                        'startdate',
                        'salary',
                        'uscitizen',
                        'workpapers',
                        'employmenttype',
                        'conviction',
                        'crimedescription',
                        'currentemployment',
                        'employmentyes',
                        'employmentno',
                        'sundaytime',
                        'mondaytime',
                        'tuesdaytime',
                        'wednesdaytime',
                        'thursdaytime',
                        'fridaytime',
                        'saturdaytime',
                        'graves',
                        'yesobligations',
                        'noobligations',
                        'previousworked',
                        'yespreviousworked',
                        'datesemployed',
                        'datesemployedreasonforleaving',
                        'driverslicense',
                        'stateissued',

                        'highschoolname',
                        'highschooladdress',
                        'highschoolyearscompleted',
                        'highschoolgraduate',
                        'highschoolmajor',
                        'highschoolgpa',

                        'certifications',

                        'universityname',
                        'universityaddress',
                        'universityyearscompleted',
                        'universitygraduate',
                        'universitymajor',
                        'universitygpa',

                        'technicalname',
                        'technicaladdress',
                        'technicalyearscompleted',
                        'technicalgraduate',
                        'technicalmajor',
                        'technicalgpa',

                        'reference1name',
                        'reference1phone',
                        'reference1yearsknown',
                        'reference1address',
                        'reference1city',
                        'reference1state',
                        'reference1zipcode',

                        'reference2name',
                        'reference2phone',
                        'reference2yearsknown',
                        'reference2address',
                        'reference2city',
                        'reference2state',
                        'reference2zipcode',

                        'reference3name',
                        'reference3phone',
                        'reference3yearsknown',
                        'reference3address',
                        'reference3city',
                        'reference3state',
                        'reference3zipcode',

                        'employment1startdate',
                        'employment1enddate',
                        'employment1companyname',
                        'employment1startsalary',
                        'employment1endsalary',
                        'employment1reasonleave',
                        'employment1contact',
                        'employment1positionsheld',
                        'employment1companyaddress',
                        'employment1phone',
                        'employment1supervisor',
                        'employment1description',

                        'employment2startdate',
                        'employment2enddate',
                        'employment2companyname',
                        'employment2startsalary',
                        'employment2endsalary',
                        'employment2reasonleave',
                        'employment2contact',
                        'employment2positionsheld',
                        'employment2companyaddress',
                        'employment2phone',
                        'employment2supervisor',
                        'employment2description',

                        'employment3startdate',
                        'employment3enddate',
                        'employment3companyname',
                        'employment3startsalary',
                        'employment3endsalary',
                        'employment3reasonleave',
                        'employment3contact',
                        'employment3positionsheld',
                        'employment3companyaddress',
                        'employment3phone',
                        'employment3supervisor',
                        'employment3description',

                        'applicantsignature',
                        'datesigned')
                        ->where('employmentapplication.id', '=', $reportprint_id)
                        ->first();
                      return view('application/applicationreportprint')->with(compact('reportprint_data'));
22 Feb
2 months ago

artisticre started a new conversation Insert ID In Different Table

I am trying to have the user_id inserted in my post table when the post is created but it isn't working. What can I do?

public function store(Request $request)
    {
        // validate the data

          $this->validate($request, array(
            'title' => 'required|max:255',
            'body' => 'required'
          ));
        //store in the database
            $post = new Post;
            $post->user_id = Auth::user()->id;
            $post->title = $request->title;
            $post->body = Purifier::clean($request->body);
            $post->user_id = $request->user_id;



            $post->save();

            Session::flash('success', 'Your Prayer Request Has Been Submitted');
        //redirect to another page

        return redirect()->route('posts.show', $post->id);

    }
15 Feb
3 months ago

artisticre started a new conversation Laravel Collective Textarea

I have a form with a textarea. The rows and cols are not doing anything. How can I make it look like a textarea and not just another input?

            {{ Form::textarea('body', null, array('class' =>'form-control input', 'cols' => 20, 'rows' =>80, 'required' => '', 'maxlength' => "400"))}}

23 Jan
3 months ago

artisticre started a new conversation CPanel Email & Laravel Contact Form

I have a form that was working with mailtrap.io. When I uploaded to my shared hosting and I changed the .env file to the credentials of my server, it acts like its working and gives the message that it was sent but it never arrives in the email box. Is this a webmail issue or do I not have something configured right with Laravel?

artisticre left a reply on SCSS Files & Shared Hosting

Yeah I just noticed it. I tried on another device and it was working so I cleared cache and bingo. Thanks for your help

artisticre left a reply on SCSS Files & Shared Hosting

There are no errors. Just layouts such as navbar. I have navbar.scss that isn't showing. The text is there but the styling isn't. I have a slider at the top of the page that isn't showing because the JS isn't showing. Things like this. Its www.traininginlifechoices.com if you want to see it

artisticre left a reply on SCSS Files & Shared Hosting

The Javascripts I have on it are not rendering either.

artisticre left a reply on SCSS Files & Shared Hosting

I tried that and uploaded the resources folder as well as the public folder. Still not working...

artisticre started a new conversation SCSS Files & Shared Hosting

I have a site I have uploaded to a shared server. It is not rendering the SCSS files and just the public CSS file. Below is my app.scss and app.blade.php files. I don't think I am linking them correctly but not sure how.


// Fonts
// @import url('https://fonts.googleapis.com/css?family=Nunito');

// Variables
@import 'variables';

@import "node_modules/font-awesome/scss/font-awesome";
// Bulma
@import 'node_modules/bulma/bulma';

//Bulma Vue node_modules
@import 'node_modules/buefy/src/scss/buefy';

 @import 'node_modules/pretty-checkbox/src/pretty-checkbox.scss';

@import 'helpers';
@import 'pagestyles';
@import 'navbar';
@import 'returntotop';
@import 'slider';
@import 'application';

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'Training In Life Choices') }}</title>
    <script src="{{asset('js/jquery.min.js')}}"></script>
    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}"></script>

    <script type="text/javascript">
  $(window).on("scroll", function() {
   if($(window).scrollTop()) {
    $('nav').addClass('blue');
   }
   else {
    $('nav').removeClass('blue');
   }
  })
  $(document).ready(function(){
    $(".menu h4").click(function(){
      $("nav ul").toggleClass("active")
    })
  })
 </script>
 <script>
 // When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
    document.getElementById("myBtn").style.display = "block";
  } else {
    document.getElementById("myBtn").style.display = "none";
  }
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
  document.body.scrollTop = 0; // For Safari
  document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
}
</script>
    <!-- Styles -->

    <link href="{{ asset('css/app.css') }}" rel="stylesheet">

</head>

<body>
<button onclick="topFunction()" id="myBtn" title="Go to top"><i class="fa fa-arrow-up" aria-hidden="true"></i></button>



<div id="app">
@include('inc.navbar')
@include('inc.slider')
@include('sections.about')
      @include('sections.about-parallax')
      @include('sections.services')
      @include('sections.services-parallax')
      @include('sections.ourteam')
      @include('sections.team-parallax')
      @include('sections.contact')
      @include('sections.footer')




     @yield('content')
    </div>


    @yield('script')

</body>
</html>
14 Jan
4 months ago

artisticre left a reply on Single Page Design & Laravel Form

I do that and I get a 419 error.

artisticre left a reply on Single Page Design & Laravel Form

in my navbar I have an anchor #contact. I want it to go back to that section once submitted

artisticre left a reply on Single Page Design & Laravel Form

Would I change my routes from

Route::get('contact', '[email protected]')->name('contact.create');
Route::post('contact', '[email protected]')->name('contact.store');

to

Route::get('#contact', '[email protected]')->name('contact.create');
Route::post('#contact', '[email protected]')->name('contact.store');

artisticre started a new conversation Single Page Design & Laravel Form

I have a simple form on a one page design. I have it displaying but I am not sure how to reroute it back to the contact form after sbumition. Below is my contactcontroller.

public function store(Request $request)
  {

    $contact = [];

      $contact['firstname'] = $request->get('firstname');
      $contact['lastname'] = $request->get('lastname');
      $contact['email'] = $request->get('email');
      $contact['phone'] = $request->get('phone');
      $contact['msg'] =  $request->get('msg');

      flash('Your Message Has Been Sent!  Someone Will Contact You Soon!')->success();
      return redirect()->url('This is my question');
    }
11 Jan
4 months ago

artisticre left a reply on Where To Put Javascript?

I am so new at scripts with laravel. what do I put in the layout file to load the script?

artisticre left a reply on Where To Put Javascript?

how do I load the script library?

artisticre started a new conversation Where To Put Javascript?

I have a very simple javascript for changing colors of the navbar. My question is where in laravel do I put javascript? I tried in app.blade.php in the header and before the closing body tag but it isn't working.

<script type="text/javascript">
   $(window).on('scroll', function() {
    if($(window).scrollTop()) {
     $('nav').addClass('black');
    }
    else {
     $('nav').removeClass('black');
    }
   })
  </script>
05 Oct
7 months ago

artisticre left a reply on Phone Number Format

So I guess I don't understand Models. I did the following as stated and I get Base table or view not found: 1146 Table 'tlcofficial.clean_phones' doesn't exist (SQL: select id, Fname, Lname, phone, email from clean_phones)

  public function index()
    {
      $admin_applist = CleanPhone::get(['id','Fname', 'Lname', 'phone', 'email']);
      return view('/admin')->with(compact('admin_applist'));
    }

and my model 

artisticre left a reply on Phone Number Format

OK I did the following and get Trying to get property of non-object

 public function getPhoneFormattedAttribute() {
      $phone = $this->phone;
  
      $ac = substr($phone, 0, 3);
      $prefix = substr($phone, 3, 3);
      $suffix = substr($phone, 6);
  
      return "({$ac}) {$prefix}-{$suffix}";
  }

    public function index()
    {
     $admin_applist = DB::table('employmentapplication')
    ->select('id','Fname', 'Lname', 'phone', 'email')
    ->get();
     return view('/admin')->with(compact('admin_applist'->phone_formatted));
    }

artisticre started a new conversation Phone Number Format

I have this function that shows the users phone number but I am not sure how to format it as (xxx) 555-1212. Any help would be appreciated.

 $admin_applist = DB::table('employmentapplication')
    ->select('id','Fname', 'Lname', 'phone', 'email')
         ->get();
         
          return view('/admin')->with(compact('admin_applist'));

28 Sep
7 months ago

artisticre started a new conversation When Logged In, Views Don't Display

When I am not logged in, all the views are showing. When I log in, the views show only the navbar. If I look at the page source code, all the data is there. What happened?

`

14 Sep
8 months ago

artisticre left a reply on PHP Artisan Serve Errors

/c/wamp64/www/lsapp this is where I am starting the server. It was working and I must have made a mistake somewhere but I can't find it

artisticre left a reply on PHP Artisan Serve Errors

So I was able to start the server with php -S 127.0.0.1:8000 server.php bu I am getting /css/app.css - No such file or directory /js/app.js - No such file or directory

because it can't find the public folder even though those folders and files do exist in the public folder. How do I changethis>

13 Sep
8 months ago

artisticre left a reply on PHP Artisan Serve Errors

what file drives looking for the public folder? It is clearly there but it can't find it?

artisticre started a new conversation PHP Artisan Serve Errors

When I use the php artisan serve command, all of a sudden I get the following error:

Lumen development server started on http://localhost:8000/
Directory 'C:\wamp64\www\lsapp/public' does not exist.

The folder is there What happened?

17 Aug
9 months ago

artisticre left a reply on Check If ID Exists Then Do Not Display

viewlist is there I just didn't copy it on this part.

  public function viewprint()
        {
           $userID = Auth::user()->id;
          $viewlist = DB::table('employmentapplication')
        ->select('id', 'userID')
        ->where('employmentapplication.userID', '=', $userID)
           ->get();
       $exists =  DB::table('employmentapplication')
             ->select('id')
             ->where('employmentapplication.id', '=', $userID)->exists();
return view('/dashboard')->with(compact('viewlist','exists'));
       }

artisticre left a reply on Check If ID Exists Then Do Not Display

This works. not sure if its the best logic but it works

$userID = Auth::user()->id;
$exists =  DB::table('employmentapplication')
             ->select('id')
             ->where('employmentapplication.id', '=', $userID)->exists();
return view('/dashboard')->with(compact('viewlist','exists'));

@if ( ! $exists) Start Application @endif

artisticre left a reply on Check If ID Exists Then Do Not Display

Perfect. Thank you so much for the help. Trying to wrap my mind around this stuff!!!

artisticre left a reply on Check If ID Exists Then Do Not Display

so how would I combine these two functions into one?

public function viewprint()
        {
           $userID = Auth::user()->id;
          $viewlist = DB::table('employmentapplication')
        ->select('id', 'userID')
        ->where('employmentapplication.userID', '=', $userID)
             ->get();
              return view('/dashboard')->with(compact('viewlist'));
        }

        public function showbutton()
        {
          // check if record exists by id
  $exists = 'Model::where('id', $id)->exists()';
  return view('/dashboard')->with(compact('exists'));
       }

artisticre left a reply on Check If ID Exists Then Do Not Display

yes, can I combine routes?