rematchka

rematchka

Member Since 2 Years Ago

Experience Points 1,080
Experience Level 1

3,920 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 1
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.

16 May
2 years ago
15 May
2 years ago

rematchka started a new conversation Laravel Migration: Auto Increment Key When It Is Not Primary

I'm trying to create a table with Laravel migrations but I'm having some trouble. I just need to create a table with a primary pair ('user_id' and 'media_id'), being 'inc' an auto increment. I can do it in MySQL, but I can't manage to do it with Laravel Migrations since increments() also set the field as primary. error i get

  SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto colu
  mn and it must be defined as a key ```

thats i hae done so far ``` public function up()
    {
        Schema::create('tagtables', function (Blueprint $table) {
            
            $table->integer('media_id');
            $table->integer('user_id');
            $table->boolean('approved')->default(false);
            $table->increments('inc')->unsigned();
            $table->timestamps();
            $table->dropPrimary( 'inc' );
            $table->primary(array('user_id','media_id'));
                        
            // $table->foreign('media_id')->references('id')->on('media')->onUpdate('cascade')->onDelete('cascade');
            // $table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
        });


        // Schema::table('tagtables', function (Blueprint $table) {
        //     //$table->increments('id');
        //     $table->primary(array('user_id','media_id'));
        //     $table->foreign('media_id')->references('id')->on('media')->onUpdate('cascade')->onDelete('cascade');
        //     $table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
            
        // });
    }```
24 Apr
2 years ago

rematchka left a reply on SQLSTATE[42S22]: Column Not Found/QueryException In Connection.php Line 647:

where to put that query (in which controller)?

i already have an email model.i cant make relation since email model has composite key . laraval controlller makes checking for me i want to change that but i dont know which controller to change or where to add

rematchka left a reply on SQLSTATE[42S22]: Column Not Found/QueryException In Connection.php Line 647:

actually i have users table(laravel defult ) and users email and i wan to query on users_email not users

rematchka started a new conversation SQLSTATE[42S22]: Column Not Found

i have a problem in resetting password mainly beacause email of users not stored in users table to when resseting password laravel check on wrong table , so how do i make it check on right on containing mail in ordr to reset password that error i get

in Connection.php line 647
at Connection->runQueryCallback('select * from `users` where `email` = ? limit 1', array('123@123.com'), object(Closure)) in Connection.php line 607
at Connection->run('select * from `users` where `email` = ? limit 1', array('123@123.com'), object(Closure)) in Connection.php line 326
at Connection->select('select * from `users` where `email` = ? limit 1', array('123@123.com'), true) in Builder.php line 1710
at Builder->runSelect() in Builder.php line 1694
at Builder->get(array('*')) in Builder.php line 452
at Builder->getModels(array('*')) in Builder.php line 436
at Builder->get(array('*')) in BuildsQueries.php line 71
at Builder->first() in EloquentUserProvider.php line 110
at EloquentUserProvider->retrieveByCredentials(array('email' => '123@123.com')) in PasswordBroker.php line 190
at PasswordBroker->getUser(array('email' => '123@123.com')) in PasswordBroker.php line 60
at PasswordBroker->sendResetLink(array('email' => '123@123.com')) in ForgotPasswordController.php line 60
at ForgotPasswordController->sendResetLinkEmail(object(Request))
at call_user_func_array(array(object(ForgotPasswordController), 'sendResetLinkEmail'), array(object(Request))) in Controller.php line 55
at Controller->callAction('sendResetLinkEmail', array(object(Request))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(ForgotPasswordController), 'sendResetLinkEmail') in Route.php line 204
at Route->runController() in Route.php line 160
at Route->run() in Router.php line 559
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in RedirectIfAuthenticated.php line 24
at RedirectIfAuthenticated->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Router.php line 561
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520
at Router->dispatchToRoute(object(Request)) in Router.php line 498
at Router->dispatch(object(Request)) in Kernel.php line 174
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54
at require_once('C:\\wamp\\www\\Menoon1\\public\\index.php') in server.php line 21
2/3
PDOException in PDOConnection.php line 79:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email' in 'where clause'
in PDOConnection.php line 79
at PDOConnection->prepare('select * from `users` where `email` = ? limit 1') in Connection.php line 319
at Connection->Illuminate\Database\{closure}('select * from `users` where `email` = ? limit 1', array('123@123.com')) in Connection.php line 640
at Connection->runQueryCallback('select * from `users` where `email` = ? limit 1', array('123@123.com'), object(Closure)) in Connection.php line 607
at Connection->run('select * from `users` where `email` = ? limit 1', array('123@123.com'), object(Closure)) in Connection.php line 326
at Connection->select('select * from `users` where `email` = ? limit 1', array('123@123.com'), true) in Builder.php line 1710
at Builder->runSelect() in Builder.php line 1694
at Builder->get(array('*')) in Builder.php line 452
at Builder->getModels(array('*')) in Builder.php line 436
at Builder->get(array('*')) in BuildsQueries.php line 71
at Builder->first() in EloquentUserProvider.php line 110
at EloquentUserProvider->retrieveByCredentials(array('email' => '123@123.com')) in PasswordBroker.php line 190
at PasswordBroker->getUser(array('email' => '123@123.com')) in PasswordBroker.php line 60
at PasswordBroker->sendResetLink(array('email' => '123@123.com')) in ForgotPasswordController.php line 60
at ForgotPasswordController->sendResetLinkEmail(object(Request))
at call_user_func_array(array(object(ForgotPasswordController), 'sendResetLinkEmail'), array(object(Request))) in Controller.php line 55
at Controller->callAction('sendResetLinkEmail', array(object(Request))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(ForgotPasswordController), 'sendResetLinkEmail') in Route.php line 204
at Route->runController() in Route.php line 160
at Route->run() in Router.php line 559
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in RedirectIfAuthenticated.php line 24
at RedirectIfAuthenticated->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Router.php line 561
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520
at Router->dispatchToRoute(object(Request)) in Router.php line 498
at Router->dispatch(object(Request)) in Kernel.php line 174
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54
at require_once('C:\\wamp\\www\\Menoon1\\public\\index.php') in server.php line 21

23 Apr
2 years ago

rematchka left a reply on Problem In Showing Errors In Right Place

well i keep getting that username has invalid credentials not password which is wrong

rematchka left a reply on Problem In Showing Errors In Right Place

i want to show errors at each input

rematchka started a new conversation Make Custom Forget Password Controller

i have email feild in another table separate from user . i want to check on email when user enter his email in check password. laravel automatically checks on email in user table but in noe doesnt exists so hoe to change that to look in right table?

rematchka started a new conversation Problem In Showing Errors In Right Place

i have override username functon in login in order to check on username instead of email . the problem happens when i try to enter wrong password and it shows that error is within usrname feild any idea what problem might be?

22 Apr
2 years ago

rematchka left a reply on Not Redirecting To Route

i did fetch it first in controller but still have same error

rematchka started a new conversation ErrorException In HasAttributes.php / Illegal Offset Type

i have problem in storing data of users ,when user sign up i store half of info in table user and other half in another table ,when hit register butttom i get that error i found that in table user info is stored correctley but in other table nothing is saved.

error

in HasAttributes.php line 818
at HandleExceptions->handleError(2, 'Illegal offset type', 'C:\\wamp\\www\\Menoon1\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Concerns\\HasAttributes.php', 818, array()) in HasAttributes.php line 818
at Model->getCasts() in HasAttributes.php line 803
at Model->hasCast('email', array('date', 'datetime')) in HasAttributes.php line 832
at Model->isDateCastable('email') in HasAttributes.php line 565
at Model->isDateAttribute('email') in HasAttributes.php line 525
at Model->setAttribute('email', '[email protected]') in Model.php line 223
at Model->fill(array('email' => '[email protected]')) in Model.php line 145
at Model->__construct(array('email' => '[email protected]')) in Model.php line 268
at Model->newInstance(array('email' => '[email protected]')) in Builder.php line 1030
at Builder->newModelInstance(array('email' => '[email protected]')) in Builder.php line 723
at Builder->create(array('email' => '[email protected]')) in Model.php line 1332
at Model->__call('create', array(array('email' => '[email protected]'))) in Model.php line 1344
at user_emails->create(array('email' => '[email protected]')) in Model.php line 1344
at Model::__callStatic('create', array(array('email' => '[email protected]'))) in RegisterController.php line 94
at user_emails::create(array('email' => '[email protected]')) in RegisterController.php line 94
at RegisterController->create(array('_token' => 'FZqd7Sc3fQRzmaQ0ImXYebzltzkygJsbKpNcZhv4', 'username' => 'vbnm v bnmm', 'email' => '[email protected]', 'password' => '1111111', 'password_confirmation' => '1111111', 'fname' => 'vbn', 'lname' => 'bnm', 'address' => 'bnm', 'membership' => 'Normal', 'pic' => object(UploadedFile))) in RegistersUsers.php line 33
at RegisterController->register(object(Request))
at call_user_func_array(array(object(RegisterController), 'register'), array(object(Request))) in Controller.php line 55
at Controller->callAction('register', array(object(Request))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(RegisterController), 'register') in Route.php line 204
at Route->runController() in Route.php line 160
at Route->run() in Router.php line 559
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in RedirectIfAuthenticated.php line 24
at RedirectIfAuthenticated->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Router.php line 561
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520
at Router->dispatchToRoute(object(Request)) in Router.php line 498
at Router->dispatch(object(Request)) in Kernel.php line 174
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54
at require_once('C:\\wamp\\www\\Menoon1\\public\\index.php') in server.php line 21

usermodal code

 public function useremail()
    {
        return $this->hasOne('App\user_emails');
    }

other table code

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

code in registercontroller

protected function create(array $data)
    {

      $fileName = 'null';
      Input::file('pic')->store('avatars');
      if (Input::file('pic')->isValid()) {
        $destinationPath = public_path('uploads/files');
        $extension = Input::file('pic')->getClientOriginalExtension();
        $fileName = uniqid().'.'.$extension;

        Input::file('pic')->move($destinationPath, $fileName);
    }
          

        $user= User::create([
            'fname' => $data['fname'],
            'lname' => $data['lname'],
            'address' => $data['address'],
            'username' => $data['username'],         
            'membership' => $data['membership'],
            'pic'=>$fileName,
            'password' => bcrypt($data['password']),
        ]);
        $useremail=user_emails::create(['email'=>$data['email']]);
      
        return $user;
    }

20 Apr
2 years ago

rematchka left a reply on How To Add Content From Database To A Modal

cant i just have 1 modal and every time i click on photo i fetch new data and insert into it?

19 Apr
2 years ago

rematchka started a new conversation Resource Interpreted As Document But Transferred With MIME Type Application/json,laravel

im trying to retrive data from db but i get that error Resource interpreted as Document but transferred with MIME type application/json: "http://127.0.0.1:8000/"

and page load with json array

[{"id":1,"pic":"C:\\Users\\extra\\Downloads","type":"img","events_id":1,"created_at":"2017-04-18 19:16:02","updated_at":"2017-04-18 19:16:02","event":null},{"id":2,"pic":"background-pics-12.jpg","type":"img","events_id":2,"created_at":"2017-04-18 19:16:02","updated_at":"2017-04-18 19:16:02","event":null}]


im unable to use data to insert it in any tags . thats code of view

<section class="no-padding" id="media">
        <div class="container-fluid">

       <ul id="hexGrid">
<!--@foreach($items as $item)  

 <li class="hex">
        <div class="hexIn">
          <a class="hexLink" href="#" id="{{$item->id}}"  role="button" data-toggle="modal" data-dismiss="modal"  data-target="#myModal">
             
            <img src="{{$item->pic}}" alt="" />
            <h1>sdfghjk</h1>
            <p>Some sample text about the article this hexagon leads to</p>

          </a>
        </div>
      </li>   

@endforeach
-->
</ul>
</div>
</section>
 
 
  <!-- Trigger the modal with a button -->
 <!-- <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-dismiss="modal" data-target="#myModal">Open Modal</button>-->

  <!-- Modal -->
   <div class="modal fade" hidden="true" id="myModal" role="dialog" tabindex="-1">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="panel panel-filled">
                <div class="panel-body">
                       <div class="modal-header">Events</div>
                <div class="modal-body">

 
 
  <div id="myCarousel" class="carousel slide" data-ride="carousel" >
         <!-- Indicators -->
   
      
    </div>
  </div>
  </div>
<script>
var xmlhttp;
   
    xmlhttp = new XMLHttpRequest();

 // var xhttp1=new XMLHttpRequest();
   
     xmlhttp.onreadystatechange=function()
     {
        if(this.readyState==4 && this.status==200)
        { 
                  var arr=JSON.parse(this.responseText);
                  console.log(arr.result.length);
                  console.log(arr);
                  var count=arr.result.length;
                  if(count!=0)
                  {
                    for(var i=0;i<count;i++)
                    {
                      if(arr.result[i].Type=='img')
                    {  var listelement=document.createElement("LI");
                      listelement.setAttribute('id', arr.result[i].ID);
                     listelement.className += "hex";
                      var div=document.createElement("div");
                      div.className += "hexIn";
                      var image=document.createElement("img");
                      
                      var heading=document.createElement("h1");
                      
                      var parag=document.createElement("p");
                      
                      
                      image.src=arr.result[i].image.replace("\\","");

                      heading.innerHTML=arr.result[i].Date; //content of  heading
                      parag.innerHTML=arr.result[i].Name;
                      var anchor=document.createElement("a");
                      anchor.className += "hexLink";
                      anchor.setAttribute('href',"#");
                      anchor.appendChild(image);
                  
                      anchor.appendChild(heading);
                      anchor.appendChild(parag);
                      div.appendChild(anchor);
                      listelement.appendChild(div);
                      var ule=document.getElementById("hexGrid");
                      ule.appendChild(listelement);
                      anchor.onclick = function(){ 
                        
  };
                    }
                    else {var listelement=document.createElement("LI");
                      listelement.setAttribute('id', arr.result[i].ID);
                     listelement.className += "hex";
                      var div=document.createElement("div");
                      div.className += "hexIn";
                      var image=document.createElement("iframe");
                      
                      var heading=document.createElement("h1");
                      
                      var parag=document.createElement("p");
                      var divv=document.createElement("div");
                      image.style["width"] = "auto";
                      image.style["height"] = "auto";
                      image.src=arr.result[i].image.replace("\\","");
                     
                      

                      heading.innerHTML=arr.result[i].Date; //content of  heading
                      parag.innerHTML=arr.result[i].Name;
                      var anchor=document.createElement("a");
                      anchor.className += "hexLink";
                      anchor.setAttribute('href',"#");
                       divv.appendChild(image);
                      anchor.appendChild(divv);
                  
                      anchor.appendChild(heading);
                      anchor.appendChild(parag);
                      div.appendChild(anchor);
                      listelement.appendChild(div);
                      var ule=document.getElementById("hexGrid");
                      ule.appendChild(listelement);}
                    }
                  }
                  else { var parag=document.createElement("p");parag.innerHTML="nmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmo";
                var ule=document.getElementById("hexGrid");
                      ule.appendChild(parag);};

        }
   };
  
     xmlhttp.open("POST","/",true);
     xmlhttp.send();





</script>
<script>
$(document).ready(function(){
  $("#myModal").on("show.bs.modal", function(e) {
      e.preventDefault();
      
      //var id1 = $(e.relatedTarget).data('target-id');
     // var id2 = $(e.relatedTarget).data('target');
      var id3 = e.relatedTarget.id;
      
    //  console.log('Val1=' + id1 + '; Val2=' + id2 + '; Val3=' + id3);
      
      
      $.get('/' + id3, function( data ) {
          alert(data);
          $(".modal-body").html(data);
      });
      
  });
});
</script>

and thats code in controller

public function getmedia()
    {


        $event=Events::all();
         $items = Media::with('event')->get();
         $e=$items->unique('events_id');
         $e->values()->all();
         return response()->json($e);
    }
    

rematchka left a reply on How To Add Content From Database To A Modal

my problem is in routing part the $get ()in javascript and rout name

rematchka started a new conversation How To Customize Forgetpassword Controller

in my database user table doesn't have email in it , email exist in another table . so when user what to reset password i want to validate mail entered by user which means i will customize forget password controller to validate email in the other table so hoe to do that?

i get that error SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email' in 'where clause' (SQL: select * from users where email = [email protected] limit 1)

i tried to override sendResetLinkEmail function but no still same error that code in forget password controller

 public function sendResetLinkEmail(Request $request)
    {
        $this->validate($request, ['email' => 'required|unique:user_emails,email']);

        // We will send the password reset link to this user. Once we have attempted
        // to send the link, we will examine the response then see the message we
        // need to show to the user. Finally, we'll send out a proper response.
        $response = $this->broker()->sendResetLink(
            $request->only('email')
        );

        return $response == Password::RESET_LINK_SENT
                    ? $this->sendResetLinkResponse($response)
                    : $this->sendResetLinkFailedResponse($request, $response);
    }


rematchka left a reply on How To Add Content From Database To A Modal

i actuallly did that but i have problems first one its not going to right route to get data from database second i get error undefined variable $sd (which is array send from database)

rematchka started a new conversation Not Redirecting To Route

Hello, I new to laravel im doing a web project which view pictures for events .in page i view one photo per event but i when user click on photo i open a bootstrap modal its body contain carousel to show the all pictures for specific evet . the problem is that on clicking on a photo i want to show associated photos from data base but it seems like javascript code (retrieve photo from db) is not executed . and i also get error. sd is supposed to be array retireved from query .

undefined variable: sd

thats code for view

<section class="no-padding" id="media">
        <div class="container-fluid">

       <ul id="hexGrid">
@foreach($items as $item)  

 <li class="hex">
        <div class="hexIn">
          <a class="hexLink" href="#" id="{{$item->id}}"  role="button" data-toggle="modal" data-dismiss="modal"  data-target="#myModal">
             
            <img src="{{$item->pic}}" alt="" />
            <h1>sdfghjk</h1>
            <p>Some sample text about the article this hexagon leads to</p>

          </a>
        </div>
      </li>   

@endforeach
</ul>
</div>
</section>
 
 
  <!-- Trigger the modal with a button -->
 <!-- <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-dismiss="modal" data-target="#myModal">Open Modal</button>-->

  <!-- Modal -->
   <div class="modal fade" hidden="true" id="myModal" role="dialog" tabindex="-1">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="panel panel-filled">
                <div class="panel-body">
                       <div class="modal-header">Events</div>
                <div class="modal-body">


 
  <div id="myCarousel" class="carousel slide" data-ride="carousel" >
         <!-- Indicators -->
 
   <ol class="carousel-indicators">
        @foreach( $sd->pic as $photo )
      <li data-target="#myCarousel" data-slide-to="{{ $loop->index }}" class="{{ $loop->first ? 'active' : '' }}"></li>
                    @endforeach
    </ol>  


    <!-- Wrapper for slides -->
   <div class="carousel-inner" role="listbox">
      @foreach( $sd->pic as $photo )
       <div class="item {{ $loop->first ? ' active' : '' }}" >
                            <img src="{{ $photo }}" alt="">
                        </div>
        @endforeach
    </div>
    <!-- Left and right controls -->
    <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
      <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
      <span class="sr-only">Previous</span>
    </a>
    <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
      <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
      <span class="sr-only">Next</span>
    </a>
  </div> 
</div>
</div>
        </div>
       
      </div>
      
    </div>
  </div>
  </div>


<script>
    $(document).ready(function(){
      $("#myModal").on("show.bs.modal", function(e) {
        var id = $(e.relatedTarget).data('target-id');
        $.get('/media' + id, function( data ) {
        alert(data);
          $(".modal-body").html(data);
        });

      });
    });
  </script>

thats code at controller and route

public function getpic($id)
{
     $sd = DB::table('media')->where('id', '=', $id);
     dd($sd);
     return view('event', ['sd' => $sd])->render();
}
Route::get('media/{id}', [
    'uses' => '[email protected]',
    'as' => 'media'
]);

rematchka started a new conversation How To Add Content From Database To A Modal

my problem is that when user click o link i want to open a modal containing further information(retrieved from database)how to do that?

rematchka started a new conversation How To Get Dynamic Data In Bootstrap Modal?

Hello, I new to laravel im doing a web project which view pictures for events .in page i view one photo per event but i when user click on photo i open a bootstrap modal its body contain carousel to show the all pictures for specific evet . the problem is that on clicking on a photo i want to show associated photos from data base but it seems like javascript code (retrieve photo from db) is not executed . and i also get error ```undefined variable: sd

which is supposed to be array retireved from query .
thats code for view 
   <ul id="hexGrid">

@foreach($items as $item)

  •         <img src="{{$item->pic}}" alt="" />
            <h1>sdfghjk</h1>
            <p>Some sample text about the article this hexagon leads to</p>
    
          </a>
        </div>
      </li>   
    

    @endforeach

    Events
    <!-- Wrapper for slides -->
    
    Previous Next
      </div>
      
    </div>
    
    $(document).ready(function(){ $("#myModal").on("show.bs.modal", function(e) { var id = $(e.relatedTarget).data('target-id'); $.get('/media' + id, function( data ) { alert(data); $(".modal-body").html(data); });
      });
    });
    
    thats code at controller
    

    public function getpic($id) { $sd = DB::table('media')->where('id', '=', $id); dd($sd); return view('event', ['sd' => $sd])->render(); } Route::get('media/{id}', [ 'uses' => '[email protected]', 'as' => 'media' ]);

    
    
  • 18 Apr
    2 years ago

    rematchka left a reply on Storing Returned Results From Database In Array And Pass It To View

    i get error Call to undefined relationship [medias] on model [App\Events].

    rematchka left a reply on Storing Returned Results From Database In Array And Pass It To View

    @edoc i dont want Events collection but Media collection realted to each event

    rematchka left a reply on Storing Returned Results From Database In Array And Pass It To View

    Thats what i get

    array:3 [▼
      0 => array:1 [▼
        "Event" => Media {#189 ▶}
      ]
      1 => array:1 [▼
        "Event" => Media {#190 ▶}
      ]
      2 => array:1 [▼
        "Event" => null
      ]
    ]
    
    

    rematchka left a reply on Storing Returned Results From Database In Array And Pass It To View

    i did but i still get same error

    Trying to get property of non-object 
    
    

    rematchka left a reply on Storing Returned Results From Database In Array And Pass It To View

    @MaverickChan i got another error when i tried ur code

    Trying to get property of non-object (View: C:\wamp\www\toottoot\myproject\resources\views\event.blade.php)
    

    rematchka left a reply on Storing Returned Results From Database In Array And Pass It To View

    i still get error

    ErrorException in 17a4b11f7089b91167770c0d718d5eb95a581119.php line 2:
    Undefined variable: items (View: C:\wamp\www\toottoot\myproject\resources\views\event.blade.php)
    

    thats view code

    @foreach($items as $items)     
    <div class="row">
           <div class="col-md-12">
       <p >{{$items->type}}</p>
           </div>
       </div>
    @endforeach
    
    

    rematchka left a reply on Unable To Add Foreign Keys Constraint In Migrations

    i wrote that line in schema create table and i have created both table users and user email

     $table->foreign('user_id')->references('id')->on('users');
    

    but i get error

    [Illuminate\Database\QueryException]
    SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint 
    

    rematchka started a new conversation Storing Returned Results From Database In Array And Pass It To View

    i want to store collection reutrned from data base in array since its executed in for loop and also i want to pass it to view. i have two tables events and media so i query to get all events then for each event i want to get corressponding media from media table and store it in array then pass it to a view

    rematchka started a new conversation Unable To Add Foreign Keys Constraint In Migrations

    im new to laraval .im working on web project. when i added foreign key constraint in migration table but when executing php artisan migrate i get.

    unable to add foreign key constraint

    17 Apr
    2 years ago

    rematchka left a reply on Invalid Argument Exception Database/custom Register Controller

    it worked .but i have another problem . when click register i have exception any idea what the problem is?

    SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fname' in 'field list'
    in Connection.php line 445
    at PDO->prepare('insert into `users` (`fname`, `lname`, `address`, `password`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?)') in Connection.php line 445
    at Connection->Illuminate\Database\{closure}('insert into `users` (`fname`, `lname`, `address`, `password`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?)', array('fd', 'fdd', 'ds', '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG', '2017-04-17 20:12:46', '2017-04-17 20:12:46')) in Connection.php line 640
    at Connection->runQueryCallback('insert into `users` (`fname`, `lname`, `address`, `password`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?)', array('fd', 'fdd', 'ds', '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG', '2017-04-17 20:12:46', '2017-04-17 20:12:46'), object(Closure)) in Connection.php line 607
    at Connection->run('insert into `users` (`fname`, `lname`, `address`, `password`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?)', array('fd', 'fdd', 'ds', '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG', '2017-04-17 20:12:46', '2017-04-17 20:12:46'), object(Closure)) in Connection.php line 450
    at Connection->statement('insert into `users` (`fname`, `lname`, `address`, `password`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?)', array('fd', 'fdd', 'ds', '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG', '2017-04-17 20:12:46', '2017-04-17 20:12:46')) in Connection.php line 404
    at Connection->insert('insert into `users` (`fname`, `lname`, `address`, `password`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?)', array('fd', 'fdd', 'ds', '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG', '2017-04-17 20:12:46', '2017-04-17 20:12:46')) in Processor.php line 32
    at Processor->processInsertGetId(object(Builder), 'insert into `users` (`fname`, `lname`, `address`, `password`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?)', array('fd', 'fdd', 'ds', '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG', '2017-04-17 20:12:46', '2017-04-17 20:12:46'), 'id') in Builder.php line 2131
    at Builder->insertGetId(array('fname' => 'fd', 'lname' => 'fdd', 'address' => 'ds', 'password' => '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG', 'updated_at' => '2017-04-17 20:12:46', 'created_at' => '2017-04-17 20:12:46'), 'id') in Builder.php line 1236
    at Builder->__call('insertGetId', array(array('fname' => 'fd', 'lname' => 'fdd', 'address' => 'ds', 'password' => '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG', 'updated_at' => '2017-04-17 20:12:46', 'created_at' => '2017-04-17 20:12:46'), 'id')) in Model.php line 677
    at Builder->insertGetId(array('fname' => 'fd', 'lname' => 'fdd', 'address' => 'ds', 'password' => '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG', 'updated_at' => '2017-04-17 20:12:46', 'created_at' => '2017-04-17 20:12:46'), 'id') in Model.php line 677
    at Model->insertAndSetId(object(Builder), array('fname' => 'fd', 'lname' => 'fdd', 'address' => 'ds', 'password' => '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG', 'updated_at' => '2017-04-17 20:12:46', 'created_at' => '2017-04-17 20:12:46')) in Model.php line 642
    at Model->performInsert(object(Builder)) in Model.php line 511
    at Model->save() in Builder.php line 724
    at Builder->Illuminate\Database\Eloquent\{closure}(object(User)) in helpers.php line 878
    at tap(object(User), object(Closure)) in Builder.php line 725
    at Builder->create(array('fname' => 'fd', 'lname' => 'fdd', 'address' => 'ds', 'password' => '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG')) in Model.php line 1332
    at Model->__call('create', array(array('fname' => 'fd', 'lname' => 'fdd', 'address' => 'ds', 'password' => '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG'))) in Model.php line 1344
    at User->create(array('fname' => 'fd', 'lname' => 'fdd', 'address' => 'ds', 'password' => '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG')) in Model.php line 1344
    at Model::__callStatic('create', array(array('fname' => 'fd', 'lname' => 'fdd', 'address' => 'ds', 'password' => '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG'))) in RegisterController.php line 73
    at User::create(array('fname' => 'fd', 'lname' => 'fdd', 'address' => 'ds', 'password' => '$2y$10$qQyEXw9ab1ZZnxGbSEqI8u9QIuTSOFWOmdynGRpPphchb6KxLMuuG')) in RegisterController.php line 73
    at RegisterController->create(array('_token' => 'aVRhsQClclbhbRItbrlKves6zTPrTFN4vJZpsSdI', 'username' => 'tr', 'email' => '[email protected]', 'password' => '111111', 'password_confirmation' => '111111', 'fname' => 'fd', 'lname' => 'fdd', 'address' => 'ds')) in RegistersUsers.php line 33
    at RegisterController->register(object(Request))
    at call_user_func_array(array(object(RegisterController), 'register'), array(object(Request))) in Controller.php line 55
    at Controller->callAction('register', array(object(Request))) in ControllerDispatcher.php line 44
    at ControllerDispatcher->dispatch(object(Route), object(RegisterController), 'register') in Route.php line 204
    at Route->runController() in Route.php line 160
    at Route->run() in Router.php line 559
    at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 30
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in RedirectIfAuthenticated.php line 24
    at RedirectIfAuthenticated->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
    at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
    at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
    at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
    at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
    at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
    at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in Router.php line 561
    at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520
    at Router->dispatchToRoute(object(Request)) in Router.php line 498
    at Router->dispatch(object(Request)) in Kernel.php line 174
    at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
    at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
    at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ValidatePostSize.php line 27
    at ValidatePostSize->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
    at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 102
    at Pipeline->then(object(Closure)) in Kernel.php line 149
    at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
    at Kernel->handle(object(Request)) in index.php line 54
    at require_once('C:\\wamp\\www\\toottoot\\myproject\\public\\index.php') in server.php line 21
    
    

    rematchka left a reply on Invalid Argument Exception Database/custom Register Controller

    InvalidArgumentException in DatabaseManager.php line 137: Database [connection] not configured. in DatabaseManager.php line 137 at DatabaseManager->configuration('connection') in DatabaseManager.php line 100 at DatabaseManager->makeConnection('connection') in DatabaseManager.php line 71 at DatabaseManager->connection('connection') in DatabasePresenceVerifier.php line 125 at DatabasePresenceVerifier->table('user_emails') in DatabasePresenceVerifier.php line 49 at DatabasePresenceVerifier->getCount('user_emails', 'email', '[email protected]', null, null, array()) in ValidatesAttributes.php line 614 at Validator->validateUnique('email', '[email protected]', array('connection.user_emails', 'email'), object(Validator)) in Validator.php line 338 at Validator->validateAttribute('email', 'unique:connection.user_emails,email') in Validator.php line 253 at Validator->passes() in Validator.php line 278 at Validator->fails() in Validator.php line 290 at Validator->validate() in RegistersUsers.php line 31 at RegisterController->register(object(Request)) at call_user_func_array(array(object(RegisterController), 'register'), array(object(Request))) in Controller.php line 55 at Controller->callAction('register', array(object(Request))) in ControllerDispatcher.php line 44 at ControllerDispatcher->dispatch(object(Route), object(RegisterController), 'register') in Route.php line 204 at Route->runController() in Route.php line 160 at Route->run() in Router.php line 559 at Router->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing{closure}(object(Request)) in RedirectIfAuthenticated.php line 24 at RedirectIfAuthenticated->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in SubstituteBindings.php line 41 at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in VerifyCsrfToken.php line 65 at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in StartSession.php line 64 at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Router.php line 561 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520 at Router->dispatchToRoute(object(Request)) in Router.php line 498 at Router->dispatch(object(Request)) in Kernel.php line 174 at Kernel->Illuminate\Foundation\Http{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing{closure}(object(Request)) in TransformsRequest.php line 30 at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in TransformsRequest.php line 30 at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in ValidatePostSize.php line 27 at ValidatePostSize->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckForMaintenanceMode.php line 46 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Kernel.php line 149 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116 at Kernel->handle(object(Request)) in index.php line 54 at require_once('C:\wamp\www\toottoot\myproject\public\index.php') in server.php line 21

    rematchka left a reply on Invalid Argument Exception Database/custom Register Controller

    i already adjusted .env and config/database.php .but i still have same problem that my .env DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=register DB_USERNAME=root DB_PASSWORD=''

    thats in config\database 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'register'), 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'engine' => null, ],

    rematchka started a new conversation Invalid Argument Exception Database

    im new to laraval. im working on website project the problem is that in registring email is not stored in user table but in another table so before inserting in database it checks if it exist before or not if it doesnt exist it store both user info and email . but that doesnt seem to work . i have error when pressing registre button InvalidArgumentException in DatabaseManager.php line 137: Database [connection] not configured.

    that is controller code(cause i think its the problem since there werent any problem in migration)

    protected function validator(array $data) { return Validator::make($data, [ 'fname' => 'required|max:255', 'email' => 'required|email|max:255|unique:connection.user_emails,email', 'password' => 'required|min:6|confirmed', 'lname'=>'required|max:255', 'address'=>'required|max:500', ]); }

    protected function create(array $data)
    {
        $user= User::create([
            'fname' => $data['fname'],
            'lname' => $data['lname'],
            'address' => $data['address'],
            'password' => bcrypt($data['password']),
        ]);
        $useremail=UserEmail::create(['email'=>$data['email']]);
        $user->useremail()->save($useremail);
        return $user;
    }
    

    rematchka left a reply on Customize Register Controller

    how to make my own custom registartion?

    rematchka left a reply on Customize Register Controller

    but thats only for validation . what if after validation i want to store email and user id ,what should i do?

    rematchka started a new conversation Customize Register Controller

    im using new to laravel. how to customize register controller ?.im working on web project where user email is not in user table (in another table) . so in authentication i want to check if email entered already exist or not before inserting . how to do it?