afonte15

Experience

8,960

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 99 Lessons Completed
  • 1 Favorite

20th June, 2017

afonte15 left a reply on Laravel Code - Vulnerable To Mysql Injections? • 1 month ago

Thank you. Will definitely be reading the link provided!

19th June, 2017

afonte15 started a new conversation Best Way To Display Search Results • 2 months ago

Hello, everyone.

I am trying to figure out if this is the best way to display search results?

 public function search()
    {
        $search = \Request::get('q'); //<-- we use global request to get the param of URI
//            $search = Input::get('search');
        $inventories = Inventory::where('lastName','LIKE','%'.$search.'%')
            -> orwhere('firstName', 'LIKE','%'.$search.'%' )
            -> orwhere('department', 'LIKE','%'.$search.'%' )
            -> orwhere('building', 'LIKE','%'.$search.'%' )
            -> orwhere('room', 'LIKE','%'.$search.'%' )
            -> orwhere('manufacturer', 'LIKE','%'.$search.'%' )
            -> orwhere('device', 'LIKE','%'.$search.'%' )
            -> orwhere('model', 'LIKE','%'.$search.'%' )
            -> orwhere('tag', 'LIKE','%'.$search.'%' )
            -> orwhere('macAddress', 'LIKE','%'.$search.'%' )
            -> orwhere('status', 'LIKE','%'.$search.'%' )
            -> orwhere('notes', 'LIKE','%'.$search.'%' )
            ->get();
        return view('computers.search',compact('inventories'));
    }

To display the results I am displaying it by location with the specific location link. So, if I would want to see all the computers located in VH, I click on the VH link on the menu. Is it optimal to do it this way, is it safe from mysql injections? Is there a better way to code the URLs? Is there a way to write it without the ? For example. http://inventory.app/computers/building/VH

<li><a href="http://inventory.app/computers?building=VH">VH</a></li>
<li><a href="http://inventory.app/computers?building=WH">WH</a></li>

routes.php

Route::auth();
Route::get('login', [email protected]');
Route::post('login', [email protected]_password');
Route::get('auth/logout', 'Auth\[email protected]');
Route::patch('computers/{inventories}', [email protected]');
Route::get('computers/search', [email protected]');
Route::resource('computers', 'InventoriesController');
Route::get('computers/create', [email protected]');
Route::get('/home', [email protected]');

afonte15 started a new conversation Laravel Code - Vulnerable To Mysql Injections? • 2 months ago

Hello,

Is my update code listed below vulnerable to mysql injections? Is this where I would protect my code from mysql injections? Thank you in advance for help.

public function update(InventoryRequest $request, Inventory $inventories){

    $inventories->update($request->all());

    flash('Success!', 'Inventory Successfully Updated!');
    return back();
}

20th April, 2017

afonte15 left a reply on Setting Up Vagrant/Homestead • 3 months ago

Issue is fixed! Needed to create a SSH key

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 3 months ago

Can I ask you one more question. I am setting up my development machine again.

Setting up vagrant/homestead

I ran bash init.sh and it said homestead initialized but when I try to navigate to the .homestead folder I get bash: cd: .homestead: No such file or directory

I am on Ubuntu 16.04

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 3 months ago

I run into this error when i have

class InventoriesController extends Controller
{
   public function __construct()
    {
        $this->middleware('auth');  
    }

But if I uncomment

class InventoriesController extends Controller
{
   public function __construct()
    {
        //$this->middleware('auth');  //does not allow users to login, redirects back to login when using LDAP credentials

    }

I am able to login and I receive no errors but then I am able to access the other web url without being logged in.

Any thoughts?

19th April, 2017

afonte15 started a new conversation Setting Up Vagrant/Homestead • 4 months ago

I am setting up Vagrant/Homestead on a Ubuntu 16.04.

I downloaded Homestead from the git repository

git clone https://github.com/laravel/homestead.git Homestead

I cd into the Homestead directory

Ran

bash init.sh

Received the message Homestead initialized!

but when I navigate to cd .homestead I get an error message that says

bash: cd: .homestead: No such file or directory

I also tried cd ~/.homestead still received the bash: cd: .homestead: No such file or directory

Any thoughts on how I can fix this?

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

[email protected]:~/sites/inventory/storage$ ls -l total 12

drwxr-xrwx 1 vagrant vagrant 4096 Mar  2 21:55 app
drwxr-xrwx 1 vagrant vagrant 4096 Mar  2 21:55 framework
drwxr-xrwx 1 vagrant vagrant 4096 Apr 18 02:04 logs
[email protected]:~/sites/inventory/storage$ cd framework
[email protected]:~/sites/inventory/storage/framework$ ls -l
total 12
drwxrwxrwx 1 vagrant vagrant 4096 Mar 10 20:55 cache
drwxrwxrwx 1 vagrant vagrant 4096 Apr 19 01:31 sessions
drwxrwxrwx 1 vagrant vagrant 4096 Apr 19 01:31 views
[email protected]:~/sites/inventory/storage/framework$ cd sessions
[email protected]:~/sites/inventory/storage/framework/sessions$ ls -l
total 20
-rw-r--r-- 1 vagrant vagrant 197 Apr 19 01:30 074589b8bef8732a3a55eaca60ceaa9e2adb4610
-rw-r--r-- 1 vagrant vagrant 360 Apr 19 01:31 21c72020b901982cd900a79aef6151ea0cd9ed72
-rw-r--r-- 1 vagrant vagrant 268 Apr 19 01:31 236b18b7007d091ef48d2d863627e545286c39e1
-rw-r--r-- 1 vagrant vagrant 349 Apr 19 01:31 f0d71b09248682b4a9688510fcd4c3001e20682a
-rw-r--r-- 1 vagrant vagrant 268 Apr 19 01:31 ff658e4153dbe2a47c29e631e8d583919f9cd549
[email protected]:~/sites/inventory/storage/framework/sessions$ 

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago


[2017-04-19 01:31:38] local.ERROR: ErrorException: file_put_contents(/home/vagrant/sites/inventory/storage/framework/sessions/ff658e4153dbe2a47c29e631e8d583919f9cd549): failed to open stream: Permission denied in /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:111
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/home/vagrant/s...', 111, Array)
#1 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(111): file_put_contents('/home/vagrant/s...', 'a:4:{s:6:"_toke...', 2)
#2 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php(83): Illuminate\Filesystem\Filesystem->put('/home/vagrant/s...', 'a:4:{s:6:"_toke...', true)
#3 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/Store.php(262): Illuminate\Session\FileSessionHandler->write('ff658e4153dbe2a...', 'a:4:{s:6:"_toke...')
#4 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(88): Illuminate\Session\Store->save()
#5 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(155): Illuminate\Session\Middleware\StartSession->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\RedirectResponse))
#6 /home/vagrant/sites/inventory/public/index.php(48): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\RedirectResponse))
#7 {main}  
[2017-04-19 01:31:38] local.ERROR: ErrorException: file_put_contents(/home/vagrant/sites/inventory/storage/framework/sessions/21c72020b901982cd900a79aef6151ea0cd9ed72): failed to open stream: Permission denied in /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:111
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/home/vagrant/s...', 111, Array)
#1 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(111): file_put_contents('/home/vagrant/s...', 'a:5:{s:6:"_toke...', 2)
#2 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php(83): Illuminate\Filesystem\Filesystem->put('/home/vagrant/s...', 'a:5:{s:6:"_toke...', true)
#3 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/Store.php(262): Illuminate\Session\FileSessionHandler->write('21c72020b901982...', 'a:5:{s:6:"_toke...')
#4 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(88): Illuminate\Session\Store->save()
#5 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(155): Illuminate\Session\Middleware\StartSession->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\RedirectResponse))
#6 /home/vagrant/sites/inventory/public/index.php(48): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\RedirectResponse))
#7 {main}  
[2017-04-19 01:31:38] local.ERROR: ErrorException: file_put_contents(/home/vagrant/sites/inventory/storage/framework/sessions/f0d71b09248682b4a9688510fcd4c3001e20682a): failed to open stream: Permission denied in /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:111
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/home/vagrant/s...', 111, Array)
#1 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(111): file_put_contents('/home/vagrant/s...', 'a:5:{s:6:"_toke...', 2)
#2 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php(83): Illuminate\Filesystem\Filesystem->put('/home/vagrant/s...', 'a:5:{s:6:"_toke...', true)
#3 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/Store.php(262): Illuminate\Session\FileSessionHandler->write('f0d71b09248682b...', 'a:5:{s:6:"_toke...')
#4 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(88): Illuminate\Session\Store->save()
#5 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(155): Illuminate\Session\Middleware\StartSession->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#6 /home/vagrant/sites/inventory/public/index.php(48): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#7 {main}  

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

I am at the login page and I provide the credentials to login and it just redirects back to the login page. Password is correct and then I check my laravel.log file and I get that permission error.

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

When I originally got the error I tried changing the permissions to the storage and boostrap/cache folder

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

[email protected]:~/sites/inventory$ ls -l total 204

drwxrwxrwx 1 vagrant vagrant   4096 Apr 13 14:17 app
-rw-rw-r-- 1 vagrant vagrant   1646 Jul 27  2016 artisan
drwxrwxrwx 1 vagrant vagrant   4096 Jul 27  2016 bootstrap
-rw-rw-r-- 1 vagrant vagrant   1386 Nov 30 22:07 composer.json
-rw-rw-r-- 1 vagrant vagrant 116748 Mar 21 16:55 composer.lock
drwxrwxr-x 1 vagrant vagrant   4096 Apr 18 15:34 config
drwxrwxr-x 1 vagrant vagrant   4096 Jul 27  2016 database
-rw-rw-r-- 1 vagrant vagrant    658 Aug 12  2016 gulpfile.js
drwxrwxr-x 1 vagrant vagrant  24576 Jul 27  2016 node_modules
-rw-rw-r-- 1 vagrant vagrant    212 Jul 27  2016 package.json
-rw-rw-r-- 1 vagrant vagrant   1026 Jul 27  2016 phpunit.xml
drwxrwxr-x 1 vagrant vagrant   4096 Aug  9  2016 public
-rw-rw-r-- 1 vagrant vagrant   1918 Jul 27  2016 readme.md
drwxrwxr-x 1 vagrant vagrant   4096 Jul 27  2016 resources
-rw-rw-r-- 1 vagrant vagrant    567 Jul 27  2016 server.php
drwxrwxrwx 1 vagrant vagrant   4096 Jul 27  2016 storage
drwxrwxr-x 1 vagrant vagrant   4096 Jul 27  2016 tests
drwxrwxrwx 1 vagrant vagrant   4096 Mar 21 16:55 vendor

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

[email protected]:~/sites/inventory$ ls -l total 204 drwxrwxrwx 1 vagrant vagrant 4096 Apr 13 14:17 app -rw-rw-r-- 1 vagrant vagrant 1646 Jul 27 2016 artisan drwxrwxrwx 1 vagrant vagrant 4096 Jul 27 2016 bootstrap -rw-rw-r-- 1 vagrant vagrant 1386 Nov 30 22:07 composer.json -rw-rw-r-- 1 vagrant vagrant 116748 Mar 21 16:55 composer.lock drwxrwxr-x 1 vagrant vagrant 4096 Apr 18 15:34 config drwxrwxr-x 1 vagrant vagrant 4096 Jul 27 2016 database -rw-rw-r-- 1 vagrant vagrant 658 Aug 12 2016 gulpfile.js drwxrwxr-x 1 vagrant vagrant 24576 Jul 27 2016 node_modules -rw-rw-r-- 1 vagrant vagrant 212 Jul 27 2016 package.json -rw-rw-r-- 1 vagrant vagrant 1026 Jul 27 2016 phpunit.xml drwxrwxr-x 1 vagrant vagrant 4096 Aug 9 2016 public -rw-rw-r-- 1 vagrant vagrant 1918 Jul 27 2016 readme.md drwxrwxr-x 1 vagrant vagrant 4096 Jul 27 2016 resources -rw-rw-r-- 1 vagrant vagrant 567 Jul 27 2016 server.php drwxrwxrwx 1 vagrant vagrant 4096 Jul 27 2016 storage drwxrwxr-x 1 vagrant vagrant 4096 Jul 27 2016 tests drwxrwxrwx 1 vagrant vagrant 4096 Mar 21 16:55 vendor

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

It seems like the webserver doesn't have permission to write to storage...what is the webserver needs write access. Do you know how I can change permission for my webserver to have access?

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

Yes. I have run it a few times at this point. Hoping that would resolve the issue. Do you know if the permission changes should be done on the host machine or the vagrant machine?

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

Yes, that is how I have always done it as well.

The error refers to a line in the filesystem.php file. Line 111

public function put($path, $contents, $lock = false)
    {
        return file_put_contents($path, $contents, $lock ? LOCK_EX : 0); //line 111
    }

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

At this point I ran the permission change on both the host and vagrant box.

What is the correct way to run the permission change commands? On my host machine which is also Ubuntu or do I change the permissions in vagrant once I SSH into it?

When I created my laravel project, when I run php artisan laravel new blog I ran that command in vagrant. Should I have ran that command on my host machine?

Is there a way to avoid this issue in the future?

18th April, 2017

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

I get the same errors after changing the permissions. Any help would be appreciated! I have been stuck on this for weeks now.

afonte15 left a reply on Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

I also ran the command below on the bootstrap/cache

sudo chmod -R o+w storage/

afonte15 started a new conversation Permission Denied - Laravel 5.2 - Vagrant • 4 months ago

local.ERROR: ErrorException: file_put_contents(/home/vagrant/sites/inventory/storage/framework/sessions/d32af67dfac92893bf1eec9768bec180cdc34e88): failed to open stream: Permission denied in /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:111

I have changed permissions. I tried

sudo chmod -R o+w storage/

and

php artisan cache:clear php artisan clear-compiled

sudo chmod -R 777 storage/ composer dump-autoload

This does not fix the issue. Any help would be appreciated.

My host machine is Ubuntu 16.04

Laravel 5.2

10th April, 2017

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

That is the error?


/home/vagrant/sites/inventory/storage/framework/views/a3058f755df9fe906eefaef2dc67bb072f13153f.php:68:
object(Illuminate\Support\ViewErrorBag)[151]
  protected 'bags' => 
    array (size=0)
      empty

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

' ' 'php /home/vagrant/sites/inventory/storage/framework/views/a3058f755df9fe906eefaef2dc67bb072f13153f.php:68: object(Illuminate\Support\ViewErrorBag)[151] protected 'bags' => array (size=0)

'''

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

I get an ldap invalid credentials error.

ldap_bind(): Unable to bind to server: Invalid credentials

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

This is what displays as the error.

ViewErrorBag {#151 ▼ #bags: [] }

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

I added use App\User; and that cleared up the error with the LoginController but now after I login it just redirects back to the login page.

When I check the network tab in my browser I get a

302 Found message on Post

And on Get I get a

200 OK

any thoughts. Possibly something with my middleware now?

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

Ok so, I thought Chmod -R 777 permission is never good to do.

I ran sudo chmod -R o+w storage/

and now after I hit login I am getting this error

FatalThrowableError in LoginController.php line 25: Class 'App\Http\Controllers\User' not found

This is progress, right? Now I am seeing an error and it seems to be an issue with my LoginController.php file.

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

I will give this a try. Yea, Homestead usually never gives me trouble. I hadn't coded for awhile and getting back into things but I already thought I adjusted my folder permissions because before this issue I was getting blank page even at start up. I will take a look at the link and most likely try your suggestion.

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

Yes, I am using Homestead.

9th April, 2017

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

laravel.log file located in app/storage/app/logs

[2017-04-03 13:10:38] local.ERROR: ErrorException: file_put_contents(/home/vagrant/sites/inventory/storage/framework/sessions/8f709f9d4f445d2772ed7f48bbb9c4bff8a63819): failed to open stream: Permission denied in /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:111
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/home/vagrant/s...', 111, Array)
#1 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(111): file_put_contents('/home/vagrant/s...', 'a:4:{s:6:"_toke...', 2)
#2 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php(83): Illuminate\Filesystem\Filesystem->put('/home/vagrant/s...', 'a:4:{s:6:"_toke...', true)
#3 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/Store.php(262): Illuminate\Session\FileSessionHandler->write('8f709f9d4f445d2...', 'a:4:{s:6:"_toke...')
#4 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(88): Illuminate\Session\Store->save()
#5 /home/vagrant/sites/inventory/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(155): Illuminate\Session\Middleware\StartSession->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#6 /home/vagrant/sites/inventory/public/index.php(48): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#7 {main}  

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

After I login I am getting a 500 Internal Server Error

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

I am not using an LDAP package.

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

I am using laravel 5.2.

I have removed the web middleware from my routes.php file and the same thing still happens. I get redirected to a blank page and the url is my login page. But I can still access my other pages when I change the url after the login redirect to the blank page.

My logout redirect works and it redirects me to the login page.

In my InventoriesController.php if I uncomment "this->middleware('auth'); then I cannot get passed the login page. After I try logging in it redirects back to the login page and actually displays the page. But I cannot access any other pages even when changing the urls manually.


<?php

namespace  App\Http\Controllers;

use Illuminate\Http\Request;
use DB;
use App\Inventory;
use App\Http\Requests\InventoryRequest;
class InventoriesController extends Controller
{
   public function __construct()
    {
        //$this->middleware('auth');  //does not allow users to login, redirects back to login when using LDAP credentials

    }

I am not sure if this makes a difference but when I list my routes in the terminal under name nothing is listed. the URI is listed as computers/create but for under name it is blank.

<blockquote class="imgur-embed-pub" lang="en" data-id="a/f5TG9"><a href="//imgur.com/f5TG9"></a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>

8th April, 2017

afonte15 started a new conversation Laravel Login Redirects To Blank Page • 4 months ago

Hello Everyone,

I have been stuck with Laravel redirecting after login. The connection works and after I login it redirects to a blank page but if I change the url path I can access the different web pages. Any assistance would be highly appreciated! I am using LDAP to connect and it is working. On my AuthController I have the protected $redirectTo paths set. See picture below. enter image description here

Please let me know if there is any other code I should provide.

Thank you!!!


<?php

namespace App\Http\Middleware;

use Closure; use Illuminate\Support\Facades\Auth;

class RedirectIfAuthenticated {

protected $auth; /**

Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@param string|null $guard
@return mixed */

public function handle($request, Closure $next, $guard = null) 
{
     if (Auth::guard($guard)->check()) { 
        return redirect('/computers/create'); 
    }

    return $next($request); 
    }

} 

7th April, 2017

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

Login
                    {{ csrf_field() }}


                    <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                        <label for="userName" class="col-md-4 control-label">Ad username</label>

                        <div class="col-md-6">
                            <input id="userName"  class="form-control" name="userName" value="{{ old('email') }}">

                            @if ($errors->has('userName'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('userName') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
                        <label for="password" class="col-md-4 control-label">Password</label>

                        <div class="col-md-6">
                            <input id="password" type="password" class="form-control" name="password">

                            @if ($errors->has('password'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('password') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" name="remember"> Remember Me
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <button type="submit" class="btn btn-primary">
                                <i class="fa fa-btn fa-sign-in"></i> Login
                            </button>

                            <a class="btn btn-link" href="{{ url('/password/reset') }}">Forgot Your Password?</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

I cannot get the code to post correctly. I am trying to paste the login.blade.php but can't at the moment.

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

computers/create ' ' ' @extends('layout')

@include('partials.mainheader')

@section('content')

<div class="row">
    <div class="container">

        <h1>Update Inventory</h1>

</div>
</div>
{{----}} {!! Form::open(['url' =>'computers']) !!} @include('computers.form', ['submitButtonText' => 'Submit Inventory'])

{!! Form::close()!!}

@include('errors.list')

@stopassola ' ' '

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

div class="container"> Login

                    {{ csrf_field() }}


                    <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                        <label for="userName" class="col-md-4 control-label">Ad username</label>

                        <div class="col-md-6">
                            <input id="userName"  class="form-control" name="userName" value="{{ old('email') }}">

                            @if ($errors->has('userName'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('userName') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
                        <label for="password" class="col-md-4 control-label">Password</label>

                        <div class="col-md-6">
                            <input id="password" type="password" class="form-control" name="password">

                            @if ($errors->has('password'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('password') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" name="remember"> Remember Me
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <button type="submit" class="btn btn-primary">
                                <i class="fa fa-btn fa-sign-in"></i> Login
                            </button>

                            <a class="btn btn-link" href="{{ url('/password/reset') }}">Forgot Your Password?</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

' ' ' @extends('layouts.app') {{--@include('partials.header')--}} @section('content')

Login
                    {{ csrf_field() }}


                    <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                        <label for="userName" class="col-md-4 control-label">Ad username</label>

                        <div class="col-md-6">
                            <input id="userName"  class="form-control" name="userName" value="{{ old('email') }}">

                            @if ($errors->has('userName'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('userName') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
                        <label for="password" class="col-md-4 control-label">Password</label>

                        <div class="col-md-6">
                            <input id="password" type="password" class="form-control" name="password">

                            @if ($errors->has('password'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('password') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" name="remember"> Remember Me
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <button type="submit" class="btn btn-primary">
                                <i class="fa fa-btn fa-sign-in"></i> Login
                            </button>

                            <a class="btn btn-link" href="{{ url('/password/reset') }}">Forgot Your Password?</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection ' ' '

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

@extends('layouts.app') {{--@include('partials.header')--}} @section('content')

Login
                    {{ csrf_field() }}


                    <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                        <label for="userName" class="col-md-4 control-label">Ad username</label>

                        <div class="col-md-6">
                            <input id="userName"  class="form-control" name="userName" value="{{ old('email') }}">

                            @if ($errors->has('userName'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('userName') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
                        <label for="password" class="col-md-4 control-label">Password</label>

                        <div class="col-md-6">
                            <input id="password" type="password" class="form-control" name="password">

                            @if ($errors->has('password'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('password') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" name="remember"> Remember Me
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-4">
                            <button type="submit" class="btn btn-primary">
                                <i class="fa fa-btn fa-sign-in"></i> Login
                            </button>

                            <a class="btn btn-link" href="{{ url('/password/reset') }}">Forgot Your Password?</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

' ' ' <?php namespace App\Http\Controllers; /**

  • @class Login / use App\User; use Illuminate\Http\Request; class Login extends Controller { /*

    • Show the application dashboard to the user.
    • @return Response */ public function index() { return view('auth.login'); } public function check_password(Request $req)

    { //die('has to stop here'); $user = User::check_password($req); //var_dump($user); die; if ($user) {

         return redirect('/computers/create');
     }
     else
    

    {

         return redirect('login')->with('message', 'Login Failed');
     }
    

    } } ' ' '

afonte15 left a reply on Laravel Login Redirects To Blank Page • 4 months ago

' ' 'Route::group(['middleware' => ['web']], function () {

Route::auth(); Route::get('login', [email protected]'); Route::post('login', [email protected]_password'); Route::patch('computers/{inventories}', [email protected]'); Route::get('computers/search', [email protected]'); Route::resource('computers', 'InventoriesController'); }); Route::get('/home', [email protected]'); ' ' '

afonte15 started a new conversation Laravel Login Redirects To Blank Page • 4 months ago

Hello Everyone,

I have been stuck with Laravel redirecting after login. The connection works and after I login it redirects to a blank page but if I change the url path I can access the different web pages. Any assistance would be highly appreciated! I am using LDAP to connect and it is working.

Everyone. I have been stuck with Laravel redirecting after login. The connection works and after I login it redirects to a blank page but if I change the url path I can access the different web pages. Any assistance would be highly appreciated! I am using LDAP to connect and it is working.

Route List

On my AuthController I have the protected $redirectTo paths set. See picture below. enter image description here

Please let me know if there is any other code I should provide.

Thank you!!!

(RedirectIfAuthenticated.php)

namespace App\Http\Middleware;

use Closure; use Illuminate\Support\Facades\Auth;

class RedirectIfAuthenticated {

protected $auth; /**

  • Handle an incoming request.

  • @param \Illuminate\Http\Request $request

  • @param \Closure $next

  • @param string|null $guard

  • @return mixed */ public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { return redirect('/computers/create'); }

    return $next($request); } }

My Routes

Route::group(['middleware' => ['web']], function () {

Route::auth(); Route::get('login', [email protected]'); Route::post('login', [email protected]_password'); Route::patch('computers/{inventories}', [email protected]'); Route::get('computers/search', [email protected]'); Route::resource('computers', 'InventoriesController'); }); Route::get('/home', [email protected]');

loginController.php

<?php namespace App\Http\Controllers;

/**

  • @class Login / use App\User; use Illuminate\Http\Request; class Login extends Controller { /*

    • Show the application dashboard to the user.
    • @return Response */ public function index() { return view('auth.login'); } public function check_password(Request $req)

    { //die('has to stop here'); $user = User::check_password($req); //var_dump($user); die; if ($user) {

         return redirect('/computers/create');
     }
     else
    

    {

         return redirect('login')->with('message', 'Login Failed');
     }
    

    } } AuthController.php

Edit Your Profile
Update

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