paklic9

paklic9

Member Since 1 Year Ago

Experience Points 210
Experience Level 1

4,790 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

28 Jan
1 year ago

paklic9 left a reply on File Validation

Thanks! That works.

paklic9 started a new conversation File Validation

I have problem with file validation. It doesnt validate. I am not sure, if I am doing it right, because I know, there is more similarly ways to do it. I wasnt using server side validation much, only at registration and in that i was using method validate(request(),[...]) and that works. Can you help me? How to validate the file.

My code:

    $files = $request->file('soubory');
    if($request->hasFile('soubory'))
    {
      foreach ($files as $file) {
        $rules = array('file' => 'required|mimes:png,gif,jpeg,txt,pdf,doc');
        $validator = \Validator::make(array('file'=> $file), $rules);
        if($validator->passes()){
        //upload file
        }
     }

Thanks in advance for help.

15 Jan
1 year ago

paklic9 left a reply on Shared Hostling - Error When Trying Insert Something To Database

@Snapey

They doesnt say, that i cannot have the file. I have it on server, but it not using it for some reason. And i dont know exactly why. On some czech forum, they just said, that I need write all to config files.

I copied whole projekt to www folder(public) and made .htaccess (that redirect to public) and code is:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/ [L]
</IfModule>

and then in public I have main .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

I had to remove this from main .htaccess(because Options -MultiViews isnt allowed):

    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

@mdecooman

Actually its just small project for my friend and he wants to have it hosted in czech (with small budget on the beginning) and he is paying it.

In near future I plan to buy some small cheapest vps (somewhere in EU) for my project, but in this situation I will need to use the shared hostling like that.

And for now I am learing/developing on localhost on windows. And I know, what is and how to use virtualbox (like a home vps).

paklic9 left a reply on Shared Hostling - Error When Trying Insert Something To Database

@mdecooman

Thanks for answer. Yeah, only I have acess to the ftp, where data are stored, so it should be okey, as you say. And no my apllication is not collecting credit cards. It would be different, if the application collects credit cards?

About that chmod, i thought it. Just some guy said it on forum, that you should do it (and here its also written https://github.com/JosefKuchar/Larawed#post-installpatch ).

P.S.: I am just beginner in all of this, still learing a lot. I recently started to interest in Laravel and all these things. And I am just student on high school, so for it I am using shared hostling(it costs less than 30$ per year without domain). VPS would be like 2x more (60$). But in future I will move to VPS. It looks like everything will work now on shared hostling also.

paklic9 left a reply on Shared Hostling - Error When Trying Insert Something To Database

Okey, I got it. The problem was in session.php and exactly in secure. I had it on true, so I set it to false and its working.

I have last two questions. Snapey why is that problem? To use it without .env file? Do I break some security thing, when i am not using .env, but filling it hardcore in config files? For example: It is safe to use it without .env in comercial use?

And do I need to set access rights 777 to storage and bootstrap/cache recursively? I found that on internet, but it looks like everything is also working without it. I am scared about setting things to 777, because it usualy break some security or am I wrong?

P.S.: All biggest shared hostlings in our country (Czech republic) do not allow to use .env file. At least, what I checked. And things like VPS are much more more expensive.

EDIT: The domain should get SSL(HTTPS) while creating, but it didnt get it for some reason... I didnt checked it, it was my bad... So I asked the hostling to give me ssl certificate, then I hope it will work with secure. Sorry for it. Anyway thank you for your help. But i am still not sure, about using laravel without .env and the access rights. If somebody can explain me that two things, I would be happy.

paklic9 left a reply on Shared Hostling - Error When Trying Insert Something To Database

jlrdw: I did these basics and pages that just show information are working. Probably something wrong with my config files? Like the sessions as Snapey said.

Snapey: I cannot use env file on this shared hostling, so I had to set all settings inside config files and I did set all setting like in .env file or default, if it wasnt in .env. And SESSION_DOMAIN wasnt in .env, so I left it on default (null). So it looks like this:

'domain' => null,

I tried to change it to:

'domain' => '.domain.cz',

But its also not working.

So what to do? Is it possible to change some parametrs in config to make it work?

Edit: maybe is problem, that I storing sessions in file (SESSION_DRIVER = file)? Should i try store it in database?

I am newbie in this, sorry.

14 Jan
1 year ago

paklic9 started a new conversation Shared Hostling - Error When Trying Insert Something To Database

Hi, I have problem with setting correctly my website on shared hosting (forpsi). On local host is all working fine. I did all what I found on internet. And all is working except one thing. The problem is, when I am trying to write/insert something to databse (login, register, insert a form).

It always do/say: The page has expired due to inactivity. Please refresh and try again. (image: https://ctrlv.cz/shots/2018/01/15/OHQX.png )

I also tried to set access rights 777 to storage and bootstrap/cache recursively, but it didnt helped. PS: Reading and getting data from database is working and showing the data from database on page is also working.

Does somebody know, how to fix it? I would be happy.

13 Jan
1 year ago

paklic9 left a reply on Undefined Variable In Function With Query

oh, that's easy. I was trying to do it much harder. :D I am beginner. Thank you so much.

paklic9 started a new conversation Undefined Variable In Function With Query

Hi, I have problem with my function, error is: "Undefined variable: filtry". I know why, the variable $filtry have to be defined in query function (like variable $j is), then it is working. But I cannot have this variable static, because variable $filtry will be always diffrent, so I need set it before function, then call it in function. Is it possible?

Thanks in advance for help.

My function:

function dbselect($tabulka, $filtry){
  $inzerce = \DB::table($tabulka)
    ->where(function($query){
      $j = 0;
      foreach ($filtry as $filtr) {
      $filtr = \Request::has($filtr) ? \Request::get($filtr) : [];
        if(isset($filtr)){
          $i = 0;
          foreach ($filtr as $polozka) {
            if ($i == 0) {
              $query->where($filtry[$j],'=', $polozka);
              $i++;
            }
            else{
            $query->orwhere($filtry[$j],'=', $polozka);
            $i++;
            }
          }
        }
      $j++;
      }
    })->get();
}

Calling function:

$filtry = ['kategorie'];
dbselect('zviratas', $filtry);