hassanshahzadaheer

hassanshahzadaheer

Member Since 11 Months Ago

karachi

Experience Points 3,800
Experience Level 1

1,200 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 31
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.

17 Jun
1 day ago

hassanshahzadaheer left a reply on Career Guide

@DEVFREY - Thanks, It was good

15 Jun
3 days ago

hassanshahzadaheer started a new conversation Career Guide

Hi! Dear all I just finish The PHP Practitioner series in which I learn a lot. I am a fresh graduate in computer science and want to start my career as a web developer I worked on java, PHP, HTML, CSS, Python, SQL but all the things are scattered in my mind. I don't have any job now.

I want to master the full stack web developer with good skills. I just want to know the roadmap that what steps do I need to achieve the goal. I am very impressed by the Jeffrey Way how long it will take to build skills like Jeffrey.

thank you so much

hassanshahzadaheer started a new conversation Warning: Require(views/{$name}.view.php):

Hi! I am facing this problem from last night I try a lot but not fix can anyone guide me how to fix this?

I make changes in pages controller file

<?php
class PagesController
{

  public function home()
  {
    $tasks = App::get('database')->selectAll('tasks');

    return view('index');

  }

  public function about()
  {

    return view('about');

  }

  public function contact()
  {
  return view('contact');

  }
}
 ?>

and got this error

Warning: require(views/{$name}.view.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/re-test/index.php on line 8

Fatal error: require(): Failed opening required 'views/{$name}.view.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/re-test/index.php on line 8

but I have a view function inside bootstrap.php let me show you this file

<?php


App::bind('config', require 'config.php');


App::bind('database', new QueryBuilder(
    Connection::make(App::get('config')['database'])
));

  function view($name)
  {
    return 'views/{$name}.view.php';
  }

?>

you can check the complete code on https://github.com/hassanshahzadaheer/Refactoring-to-Controller-Classes-ep-23

13 Jun
5 days ago

hassanshahzadaheer left a reply on Object Not Found (The PHP Practitioner Episodes-17)

@JLRDW - yes why not

I made a change in router.php & htaccess

In the start, I place the root directory

<?php

$router->get('re-test','controllers/index.php');
$router->get('re-test/about','controllers/about.php');
$router->get('re-test/about/culture','controllers/about-culture.php');
$router->get('re-test/contact','controllers/contact.php');
$router->get('names','controllers/add-name.php');

RewriteEngine On
RewriteBase /re-test/
AddType text/css .css
AddType text/javascript .js
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteRule ^.*$ index.php [END]

12 Jun
6 days ago

hassanshahzadaheer left a reply on Object Not Found (The PHP Practitioner Episodes-17)

Hi! Dear all thank you so much for your help I have resolved my issue after a long time.

thank you

hassanshahzadaheer started a new conversation $_SERVER['REQUEST_URI']

Hi! dear I re-write the code and experience on the

$_SERVER['REQUEST_URI'] 

that my pages do not change it is still on the root directory which is re-test let me show the image of my result page

this is about/culture page now I understand is that must be the re-test/about/culture but the request_uri not return the right path

https://prnt.sc/o0wv8f

can you please now figure out what is the problem

thank you so much

hassanshahzadaheer left a reply on Object Not Found (The PHP Practitioner Episodes-17)

Hi! dear I re-write the code and experience on the

$_SERVER['REQUEST_URI'] 

that my pages do not change it is still on the root directory which is re-test let me show the image of my result page

this is about/culture page now I understand is that must be the re-test/about/culture but the request_uri not return the right path

https://prnt.sc/o0wv8f

can you please now figure out what is the problem

thank you so much

hassanshahzadaheer left a reply on Object Not Found (The PHP Practitioner Episodes-17)

@SNAPEY - I think no because I also try to update my routers.php class

<?php

$router->define([
    '' => 'controllers/index.php',
    'about' => 'controllers/about.php',
    'about/culture' => 'controllers/about-culture.php',
    'contact' => 'controllers/contact.php'
]);

with

  <?php

  $router->define([
      'basicPHP/' => 'controllers/index.php',
      'basicPHP/about' => 'controllers/about.php',
      'basicPHP/about/culture' => 'controllers/about-culture.php',
      'basicPHP/contact' => 'controllers/contact.php'
  ]);

hassanshahzadaheer left a reply on Object Not Found (The PHP Practitioner Episodes-17)

Hi! please let me know how to set this project

hassanshahzadaheer left a reply on Object Not Found (The PHP Practitioner Episodes-17)

@JLRDW - could you please give me the exact piece of code that I apply to run my project I will very thankful to you. This error stuck my life

hassanshahzadaheer left a reply on Object Not Found (The PHP Practitioner Episodes-17)

@JLRDW - now show me this Fatal error: Uncaught Exception: No route defined for this URI. in /opt/lampp/htdocs/basicPHP/core/Router.php:27 Stack trace: #0 /opt/lampp/htdocs/basicPHP/index.php(6): Router->direct('/basicPHP/') #1 {main} thrown in /opt/lampp/htdocs/basicPHP/core/Router.php on line 27

hassanshahzadaheer left a reply on Object Not Found (The PHP Practitioner Episodes-17)

@SNAPEY - I remove it and set as the author code

class Request { public static function uri() { return trim($_SERVER['REQUEST_URI'], '/'); } }

but nothing gets change now the index page also shows the

`` Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404 localhost Apache/2.4.37 (Unix) OpenSSL/1.0.2q PHP/7.1.26 mod_perl/2.0.8-dev Perl/v5.16.3 ``

11 Jun
1 week ago

hassanshahzadaheer started a new conversation Object Not Found (The PHP Practitioner Episodes-17)

HI!

I have still a problem with the document root I applied all the solution, also change my operating system, completely remove XAMPP and install Apache & MySQL locally this method not work for me and then I reinstall xampp then try to run the app but noting gets change.

Now the home page loaded but when I visited any link it shows me this error

`` Object not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404 localhost Apache/2.4.37 (Unix) OpenSSL/1.0.2q PHP/7.1.26 mod_perl/2.0.8-dev Perl/v5.16.3 ``

here are those link in which I define my problem

https://laracasts.com/discuss/channels/requests/the-php-practitioner https://stackoverflow.com/questions/55365071/problem-with-redirect-to-other-pages-using-uri

14 Apr
2 months ago

hassanshahzadaheer left a reply on The PHP Practitioner

HI! can anyone answer!!!!

12 Apr
2 months ago

hassanshahzadaheer left a reply on The PHP Practitioner

@JLRDW - HI! dear jlrdw. I made changes but notings gets change

<Directory />
    Options FollowSymLinks
    AllowOverride FileInfo
    Require all granted
</Directory>

<Directory /usr/share>
    AllowOverride FileInfo
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride FileInfo
    Require all granted
</Directory>

<Directory /srv/>
    Options Indexes FollowSymLinks
    AllowOverride FileInfo
    Require all granted
</Directory>

I made this change in apache2.conf because in my system there is no file with the name of httpd.conf

and when I make the .htaccess file and add this line of code then It shows this error

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.29 (Ubuntu) Server at localhost Port 80

Thank you so much

11 Apr
2 months ago

hassanshahzadaheer left a reply on The PHP Practitioner

@SNAPEY - HI! dear snapey !

I did this process but not working just show page not found.

https://www.dyclassroom.com/howto-ubuntu/how-to-change-document-root-of-apache-on-ubuntu

also, I uninstall the xampp and then install PHP MySQL apache manually then run the code noting happen.

just home page open successfully other all links show

Not Found
The requested URL /about was not found on this server.

Apache/2.4.29 (Ubuntu) Server at localhost Port 80

why this happens can you please help me to sort it out.

hassanshahzadaheer left a reply on The PHP Practitioner

@JLRDW - I clone it on my laptop and run it but it throws the exception Fatal error: Uncaught exception 'Exception' with message 'No route defined for this URI.' in /home/ubuntu/workspace/learnPHP/core/Router.php:27 Stack trace: #0 /home/ubuntu/workspace/learnPHP/index.php(6): Router->direct('learnPHP') #1 {main} thrown in /home/ubuntu/workspace/learnPHP/core/Router.php on line 27

10 Apr
2 months ago

hassanshahzadaheer left a reply on The PHP Practitioner

@JLRDW - Thank you so much, my bro!

I want to work on basic PHP I think the document root structure you share with me is Laravel. can you explain to me a bit more?

Thanks

hassanshahzadaheer left a reply on The PHP Practitioner

@SNAPEY - linux operating system Ubuntu 18.4

09 Apr
2 months ago

hassanshahzadaheer left a reply on Redirecting URL Problem

@SNAPEY - hi please help me how to set the document root. I am starting this series from start.

hassanshahzadaheer started a new conversation The PHP Practitioner

HI! dear I am going to start this series again because I am not understanding where I am wrong and no solution works for me. Can anyone help me how to set the document root so I can do my work?

this is the link of which I am facing the problem I posted the question on StackOverflow also https://laracasts.com/discuss/channels/requests/redirecting-url-problem

StackOverflow link

https://stackoverflow.com/questions/55365071/problem-with-redirect-to-other-pages-using-uri/55433773?noredirect=1#comment97667521_55433773

Thank you so much.

29 Mar
2 months ago

hassanshahzadaheer started a new conversation 500 Whoops, Something Went Wrong On Our Servers.

laracasts discussion show error

https://laracasts.com/discuss

display 500 error

hassanshahzadaheer left a reply on Redirecting URL Problem

@SNAPEY - could you please help me how to set the document root. Thanks

28 Mar
2 months ago

hassanshahzadaheer left a reply on Redirecting URL Problem

@SNAPEY - Hi! snapey thanks for the help

maybe something goes wrong with

Request.php file

I try this

<?php
class Request
{
    public static function uri()
    {

      $uri = (substr($_SERVER['REQUEST_URI'],10));
      $removeSlash = rtrim($uri, '/');
      return var_dump($removeSlash);

    }
}

instead of this

<?php
class Request
{
    public static function uri()
    {
        return trim($_SERVER['REQUEST_URI'], '/');
    }
}

I replace the code because it was not working for me

thanks

hassanshahzadaheer left a reply on Redirecting URL Problem

@SNAPEY - I use the Linux operating system, web server is xampp 7.1.26-0

PHP 7.2.15-0ubuntu0.18.04.2 (cli) (built: Mar 22 2019 17:05:14)

27 Mar
2 months ago

hassanshahzadaheer left a reply on Redirecting URL Problem

please check the video in which maybe you understand the problem here the link

https://www.useloom.com/share/5199399f3b5f42dd9c589a47dad0738f

hassanshahzadaheer left a reply on Redirecting URL Problem

@TOKOIWESLEY - Hi thanks for your replay. I am not using any framework it is a cure php I follow the series https://laracasts.com/series/php-for-beginners

and problem occurs in video number 17 Dry Up Your Views video link

https://laracasts.com/series/php-for-beginners/episodes/17

Is anything more to share if you want

thanks

hassanshahzadaheer left a reply on Redirecting URL Problem

Hi thanks for your replay. I am not using any framework it is a cure php I follow the series https://laracasts.com/series/php-for-beginners

and problem occurs in video number 17 Dry Up Your Views video link

https://laracasts.com/series/php-for-beginners/episodes/17

Is anything more to share if you want

thanks

hassanshahzadaheer started a new conversation Redirecting URL Problem

Hi please help me I am stuck in the URL problem I post a question but no one replay

I post it also on stack overflow please check the link

https://stackoverflow.com/questions/55365071/problem-with-redirect-to-other-pages-using-uri

09 Mar
3 months ago

hassanshahzadaheer started a new conversation Uri Add To My Link Automatically

HI! dear all I am facing the problem of URI add a loop in my PHP links I describe the problem in this video please check it and let me know where I am wrong.

18 Jul
11 months ago

hassanshahzadaheer started a new conversation Vagrant Box Add Laravel/homestead :- GnuTLS Recv Error (-54): Error In The Pull Function.

Hi! I face laravel homestead installation issue. I Install v-box and vagrant successfully on Linux machine ubuntu 16.4 when I add the homestead by running following command

"vagrant box add laravel/homestead" . It can take some time and show this error

"An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again.

GnuTLS recv error (-54): Error in the pull function."

I change the internet connect multiple time try some other command like vagrant up and vagrant box add laravel/homestead --clean but not get any success I also find some posted solution but not work for me. I also start lampp server but noting change same problem occur again.

can anyone guide what to do and how to install it or any other alternative way to install here is my terminal screenshot https://prnt.sc/k83ubx

thank you so much