Our Black Friday sale is now live! All individual subscriptions are 50% OFF. This week only!

Bosstone

Bosstone

Member Since 2 Years Ago

Experience Points
1,310
Total
Experience

3,690 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,310 XP
Nov
15
1 week ago
Activity icon

Started a new Conversation Rollback Migration: Kill

Hi,

I have accidently made a

php artisan migrate:rollback --step=2

on the wrong application on forge (shame on me). The rollback causes with an error because of a duplicate field:

Migrating: 2020_07_30_063808_add_reject_text_to_projects_table

   Illuminate\Database\QueryException  : SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'reject_text' (SQL: alter table `projects` add `reject_text` varchar(191) null)

  at /home/forge/app.austrianweddingaward.at/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|

  Exception trace:

  1   PDOException::("SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'reject_text'")
      /home/forge/app.austrianweddingaward.at/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458

  2   PDOStatement::execute()
      /home/forge/app.austrianweddingaward.at/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458



How can I stop this rollback on forge.laravel.com?

thank you very much for your time!

Stefan

Oct
23
1 month ago
Activity icon

Replied to Password Reset Link

Shame on me. Sorry - you are absolutely right. I have forgotten to check on forge... I just searched the project directly in atom...

Activity icon

Started a new Conversation Password Reset Link

Hi,

I have cloned my laravel app from app.austrianweddingaward.at to app.weddingawardgermany.de. Now, when I press on the new created "Germany" App the "Forget Passowrd Button", the E-Mail with the change password button shows the link to the old "Austrian" App.

If you’re having trouble clicking the "Passwort zurücksetzen" button, copy and paste the URL below into your web browser: https://app.austrianweddingaward.at/password/reset/

Can you please tell me where this has to be changed?

Thank you very much,

Stefan

Oct
20
1 month ago
Activity icon

Replied to Pass Variables To Create A New User

Hi Sinnbeck, thank you again for your help.

That was exactly the same I was thinking about. Why not add this data into the form on my wordpress page and send it to create-exhibitor...

But then my data is just in the laravel database and not in the Wordpress database? Or do I have to cascade form into form in my wordpress page? I will have to investigate into that further...

Or will it - in my case, not be easier to let the user register on my wordpress page, then create the URL for the Laravel App and send the Variables with get to the Laravel Page and create the User there. If I send the user to the Homepage of the Laravel Page after User Creation, then the User will never see the URL Parameters... Or I could even secure the user data with a hash...

What do you think?

All the best,

Stefan

Activity icon

Replied to Pass Variables To Create A New User

Hi Sinnbeck,

I tried with

URL/create-exhibitor/stefan/lehrner/.... but got an "Sorry, the page you are looking for could not be found."

The reason I want to send via URL: I am organising exhibitions. The Exhibitors will do their registration on a Wordpress page. The data they enter there should be send to the laravel app where a new user will be created. So I think I have to send the variables from Wordpress to Laravel via URL, or is there another solution I can use?

Thank you for your help,

Stefan

Activity icon

Replied to Pass Variables To Create A New User

Dear Sinnbeck,

thank you very much for your help, support and advice. In the way you suggested, how do I send the Variables?

Thank you very much for your help,

Stefan

Activity icon

Replied to Pass Variables To Create A New User

Dear Mariano,

you are absolut right. Both suggestions :-)

Thank you very much...

All the best, Stefan

Oct
19
1 month ago
Activity icon

Replied to Pass Variables To Create A New User

Hi,

thank you very much for your support and your help. I achieved it like this:

Route::get('/{name}/{lastname}/{email}/{company}/{sector}/','Auth\[email protected]');

and the controller - Auth\RegisterController:

  public function insertAPI(Request $request, $name, $lastname, $email, $company, $sector)
    {

      $permitted = "123456789ABCDEFG";
      $pass = substr(str_shuffle($permitted), 0, 8);

      $role = 1;

      User::create([
          'name' => $name,
          'lastname' => $lastname,
          'email' => $email,
          'role' => $role,
          'company' => $company,
          'sector' => $sector,
          'password' => bcrypt($pass),
      ]);

    }

I am using the build in authentication system of laravel and unfortunately, the data will not be passed into the tables USER

When I open the URL:

stefan/lehrner/[email protected]/big-day.photo/Fotografie/

and echo all the Variables I get

[email protected]

so this is fine - but in the DB only the Name (Stefan), Lastname (lehrner), EMail ([email protected]) and the Password (bcrypt of $pass) are entered into the DB. I know, that I am missing something, but I do not know where...

Thank you for your feedback,

Stefan

Activity icon

Started a new Conversation Pass Variables To Create A New User

Hi, I have a registration form (not in laravel) which I want to use to populate my laravel user table:

I have created a route:

Route::get('/name/{name}/lastname/{lastname}/email/{email}/company/{company}/sector/{sector}' , 'Auth\[email protected]_exhibitor');

and a function in my controller

use Illuminate\Http\Request;

public function create_exhibitor(array $data) {

          $alphabet = "ABCDEFGHI0123456789";
            for ($i = 0; $i < 8; $i++) {
                $n = rand(0, count($alphabet)-1);
                $pass[$i] = $alphabet[$n];
            }

           $name = Input::get('name');
           $lastname = Input::get('lastname');
           $email = Input::get('email');
           $company = Input::get('company');
           $sector = Input::get('sector');
           $role = 1;

          return User::create([
              'name' => $name,
              'lastname' => $lastname,
              'email' => $email,
              'role' => $role,
              'company' => $company,
              'sector' => $sector,
              'password' => bcrypt($pass),
          ]);
    }

when I now want to pass the variables then I get the following error:


Argument 1 passed to App\Http\Controllers\Auth\RegisterController::create_exhibitor() must be of the type array, string given

What I am missing? How can I solve this issue?

Thank you very much for your help,

Stefan

Oct
18
1 month ago
Activity icon

Started a new Conversation Laravel Update To 6.x

I have managed it to update from 5.8 to 6.x - but got an error

Call to undefined function str_slug() in sessions.php on line 122

I found out, that helpers are removed in 6.x and have to be installed using

composer require laravel/helpers
php artisan view:clear

https://laravel.com/docs/6.x/upgrade

I did this, but deployment failed because of:

Sun Oct 18 20:10:05 UTC 2020
From github.com:Transferista/virtual
 * branch            master     -> FETCH_HEAD
Already up to date.

In ProviderRepository.php line 208:
                                                         
  Class 'Collective\Html\HtmlServiceProvider' not found  

How can I solve this issue?

All the best,

Stefan

Activity icon

Replied to Laravel 5.7.29 - Undefined Index: Email

Oh - thank you. I had a

value="{{ $_GET['email'] }}"

In my code - 5.5 did not had any problems with that...

Activity icon

Started a new Conversation Laravel 5.7.29 - Undefined Index: Email

Hi, I am upgrading my Website from 5.5 to 8.x step by step.

I have managed to update from 5.5 to 5.6. Now I tried to update from 5.6 to 5.7.29. Now I get this error when I try to register a new user:

Undefined index: email (View: /home/forge/virtual.weddingexpo.at/resources/views/auth/register.blade.php)

How can this be solved?

Thank you for your time!

Stefan

Activity icon

Replied to Update 5.5 -> 8.x

Thank you very much. It was the TrustedProxies.php which caused the error:

OLD:


protected $headers = [
        Request::HEADER_FORWARDED => 'FORWARDED',
        Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
        Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
        Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
        Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
    ];

new

protected $headers = Request::HEADER_X_FORWARDED_ALL;

Activity icon

Started a new Conversation Update 5.5 -> 8.x

Hi,

I am updating my laravel (with twilio) app from 5.5 to 8.x.

I am using forge - and I am updating step by step from 5.5 to 5.6,....

I have seen that I have to enter this Code in my EncryptCookies.php:

   /**
   * Indicates if cookies should be serialized.
   *
   * @var bool
   */
   protected static $serialize = true;

my EncryptCookies.php looks like:


   <?php

   namespace App\Http\Middleware;

   use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;

   class EncryptCookies extends Middleware
	{
    /**
     * The names of the cookies that should not be encrypted.
     *
     * @var array
     */
    protected $except = [
        //
    ];

   }

But where should I put the code?

Thank you for your feedback,

Stefan

Jul
27
4 months ago
Activity icon

Replied to Laravel With Forge And Github

Hi, thank you very much for your support. I have this in my deploy script:

cd /home/forge/app.austrianweddingaward.at
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader

( flock -w 10 9 || exit 1
    echo 'Restarting FPM...'; sudo -S service php7.4-fpm reload ) 9>/tmp/fpmlock

if [ -f artisan ]; then
    php artisan migrate --force
fi

This is my function


public function rejectProject(Request $data) {

        $id = $data->id;
        $project = Project::find($id);
        $project->stat = '3';
        $project->save();

        //get user email
        $project = Project::where('id', $id)->first();
        $user_id = $project->user_id;
        $user = User::where('id', $user_id)->first();

        //Add to table RejectingProject - this is what I have add to the function

        DB::table('rejects')->insert(
               array(
                      'user_id'     =>  $user_id,
                      'project_id'   =>  $id,
                      'projectname' => $project->name,
                      'text' => $data->emailBody
               )
          );

	//but it is not adding to the rejects table. I have also add app\Reject in the beginning of the script.

        // Send Email
        Mail::to($user->email)->send(new RejectingProject($data->emailBody, $project->name, $user->vorname.' '.$user->name));

        Session::flash('alert-success','Das Projekt wurde erfolgreich zurückgewiesen.');

        return response()->json(array('msg'=> 'Success'), 200);
    }

This is what I have add to the code, but it is not putting anything into the database. The idea is - instead of only sending Status E-Mail to the Customer, I will add the text of the E-Mail into a Table "Rejects" to show the text in the dashboard of the user:


//Add to table RejectingProject - this is what I have add to the function

        DB::table('rejects')->insert(
               array(
                      'user_id'     =>  $user_id,
                      'project_id'   =>  $id,
                      'projectname' => $project->name,
                      'text' => $data->emailBody
               )
          );

	//but it is not adding to the rejects table. I have also add app\Reject in the beginning of the script.

Thank you for your help!

Stefan

Activity icon

Started a new Conversation Laravel With Forge And Github

Hi, I am running my laravel app with Github and deploy it using forge. I need to add a new table into my app. Which steps do I have to do, to deploy the new table?

I have never done this before, so I do not know the necessary steps. In my mind, I have to

  • create a new Class "Reject"
  • create a new table "Rejects" with the fields (create_rejects_table.php)

in Atom, then push it using Github and deploy using forge. Am I right?

Thanks for your feedback and your advices,

Stefan