V
V
vvmgev2015-10-27 21:26:48
Laravel
vvmgev, 2015-10-27 21:26:48

Why doesn't Auth::check() work in laravel?

I have a class that has several actions and the one who logged in can enter there

public function __construct(){

    if(!Auth::check()){
      return redirect('/');
    }

  }

it doesn't work that way it works
public function index()
  {
    if(!Auth::check()){
      return redirect('/');
    }
    echo 'index';
  }

but it's not right not to write professionally in all actions
sorry for my english

Answer the question

In order to leave comments, you need to log in

6 answer(s)
M
Mikhail Osher, 2015-10-27
@vvmgev

Read about middleware auth.

O
Otkrick, 2013-04-24
@maeln0r

image
On NG I bought myself an Asus P53E , twisted the drive and instead of it put an ssd'shnik + added memory through the chassis . The screen is matte, the case/design is very nice (metal), the keys are very large, I compile large projects on a remote server, otherwise the performance is enough (I use Linux Mint DE, the second one is Win7 from the kit). I tried this: I set Proxmox with X as the main axis, started a win2003 virtual machine on ssd with periodic snapshots to hard, when the laptop was turned on, it automatically connected rdesktop to Windows, and added test virtual machines via web-gui and worked with them. In general, it works great, but youtube in full screen mode slows down due to rdesktop (updating the picture from top to bottom is noticeable).

D
Dmitry Karassev, 2013-04-24
@Skerrigan

Asus (K55A)(HD) is a very good machine for the money.
The body was finally made not crumbling after a couple of months.
15.6" - 1366x768
CPU - i5 3210M (2600 MHz)
Chipset - Intel HM76
Memory - 4096 MB (1600 MHz ... up to 8GB)
Video subsystem - Intel HD Graphics 4000
USB 3.0 - 2
USB 2.0 - 1
Weight - 2.5 kg
Price in Tomsk DNS 22t.r.
PS — I took it to a close friend a couple of weeks ago with the same requirements as you. He was very pleased ;)

S
Sergey, 2013-04-24
@serega_kaktus

asus k53s. There is nothing to compare with, since I only had two laptops. I will say for sure - it does not heat up, even in games the case does not heat up. The RAM and power of the processor will be enough to run many heavy applications. I myself work as a programmer. IDE + chrome + FF + local server + a few more applications on Ubuntu 12.04 with various compize beauties work quite tolerably. Of the minuses - the keyboard is different from the usual. But you can always connect an external one. Or you can get used to it in a week.

S
SleepingLion, 2013-04-24
@SleepingLion

The keyboards of the latest asus have a serious minus - the Del + Ins keys (Ins = FN + Del) are combined and the arrow block is not highlighted in any way. If you use the Insert button, then this may not be very convenient.
And the rest - excellent laptops, they upgrade remarkably.

M
maeln0r, 2013-04-24
@maeln0r

Thank you all for your answers, I will focus on this model , I really liked the keyboard. And the charging location, as they did for me, on the left)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question