kodemania

kodemania

Member Since 3 Years Ago

Experience Points 14,425
Experience Level 3

575 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 155
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.

05 Jun
3 years ago

kodemania left a reply on Has Anyone Tried Laravel Integrated Package In Laravel 5.2?

Hey everyone,

I used it as it is stated and now all seleniums tests are getting skipped.

17 May
3 years ago

kodemania left a reply on Help With Laravel URL Helper Function

try this. set APP_URL in env file.

url (env('APP_URL'),'signup/activate'))

For me it works in email template and I was also facing same issue with queue and emails.

27 Apr
3 years ago

kodemania left a reply on Risky Test PhpUnit

it just showing Ok but incomplete, skipped or risky tests

kodemania left a reply on Risky Test PhpUnit

My controller

<?php

namespace App\Http\Controllers\Auth;

use App\Contracts\Repositories\SocialUserRepositoryInterface;
use App\Contracts\Repositories\UserProfileRepositoryInterface;
use App\Contracts\Repositories\UserRepositoryInterface;
use App\Contracts\Services\EmailServiceInterface;
use App\Contracts\Services\LoggerServiceInterface;
use App\Contracts\Services\RedirectServiceInterface;
use App\Contracts\Services\RegistrationServiceInterface;
use App\Http\Requests\SignupRequest;
use Exception;
use GuzzleHttp\Exception\ClientException;
use Illuminate\Http\Request;
use Illuminate\Session;

use App\Http\Controllers\Controller;
use Laravel\Socialite\Facades\Socialite;

class SignupController extends Controller
{

    /**
     * @var UserRepositoryInterface
     */
    private $repository;

    /**
     * @var RedirectServiceInterface
     */
    private $redirectService;

    /**
     * @var LoggerServiceInterface
     */
    private $logger;

    /**
     * @var EmailServiceInterface
     */
    private $mailer;

    /**
     * @var UserProfileRepositoryInterface
     */
    private $profileRepository;

    /**
     * @var SocialUserRepositoryInterface
     */
    private $socialRepository;

    /**
     * @param UserRepositoryInterface $userRepo
     * @param RedirectServiceInterface $redirectService
     * @param LoggerServiceInterface $logger
     * @param EmailServiceInterface $mailer
     * @param UserProfileRepositoryInterface $profileRepository
     */
    function __construct(UserRepositoryInterface $userRepo,RedirectServiceInterface $redirectService,LoggerServiceInterface $logger, EmailServiceInterface $mailer, UserProfileRepositoryInterface $profileRepository, SocialUserRepositoryInterface $socialUser ){

        /** UserRepository instance */
        $this->repository = $userRepo;

        /** RedirectService instance */
        $this->redirect  =   $redirectService;

        /** LoggerService instance */
        $this->logger   =   $logger;

        /** Email Service instance */
        $this->mailer   =   $mailer;

        /** UserProfileRepository instance */
        $this->profileRepository    =   $profileRepository;

        /** SocialUserRepository instance */
        $this->socialRepository = $socialUser;
    }

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return view('auth.signup');
    }


    /**
     * Signs up New User to Our System.
     *
     * @param SignupRequest $request
     * @param RegistrationServiceInterface $registrationService
     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
     */
    public function doSignup(SignupRequest $request, RegistrationServiceInterface $registrationService){

        $type = 'form';

        try{
            $newRegisteredUser = $registrationService->registerUser($type,$request->all(),$this->repository,$this->profileRepository);
            $this->mailer->sendWelcomeEmail($newRegisteredUser);
            $messageLangKey = 'auth.welcome';
            return $this->redirect->toSignup("successMessage",$messageLangKey);
        }
        catch( Exception $e ){
            $this->logger->logException($e,"emergency");
        }
        $messageLangKey = 'auth.error';
        return $this->redirect->toSignup("failureMessage",$messageLangKey);
    }

    /**
     * redirects user to facebook oAuth api
     *
     * @return mixed
     */
    public function facebookSignup(){
        return Socialite::driver('facebook')->scopes([
            'public_profile',
            'email',
            'user_about_me',
            'user_birthday',
            'user_hometown',
            'user_location',
            'user_website',
            'manage_pages',
            'publish_pages'
        ])->redirect();
    }

    /**
     * Callback function for facebook oAuth api
     * @param RegistrationServiceInterface $registrationService
     * @return mixed
     */
    public function facebookCallback(RegistrationServiceInterface $registrationService){

        try{

            $user = Socialite::driver('facebook')->user();

            $type = 'facebook';

            $columns = array(
                'social'    =>  true,
                'active'    =>  true,
                'username'  =>  implode("",explode(" ",$user->name)),
                'email'     =>  $user->email,
                'name'      =>  $user->name,
                'provider'  =>  $type,
                'token'     =>  $user->token,
            );

            if(isset($user->user["gender"])){
                array_add($columns,"gender", ($user->user["gender"] == "male")? true : false );
            }

            $newRegisteredUser = $registrationService->registerUser($type,$columns,$this->repository,$this->profileRepository,$this->socialRepository);

            $this->mailer->sendWelcomeEmail($newRegisteredUser);

            $messageLangKey = 'auth.welcome';

            return $this->redirect->toSignup("successMessage",$messageLangKey);
        }
        catch(ClientException $e){
            $messageLangKey = 'auth.socialError';
            return $this->redirect->toSignup("successMessage",$messageLangKey);
        }
        catch(Exception $e){
            $this->logger->logException($e,"emergency");
        }

        $messageLangKey = 'auth.error';
        return $this->redirect->toSignup("failureMessage",$messageLangKey);
    }
}

My test for this controller

<?php

use App\Repositories\UserProfileRepository;
use App\Repositories\UserRepository;
use App\Services\RegistrationService;
use App\UserProfile;
use App\User;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Hash;

class SignupTest extends TestCase
{
    use DatabaseTransactions;
    /**
     * A basic test example.
     *
     * @return void
     */
    public function testSignup_process_fresh_user()
    {
        $username = str_random(16)."yousa".time();

        $password = str_random(16);

        $email = $username."@gmail.com";

        $this->visit('signup')
            ->type($username,'username')
            ->type($password,'password')
            ->type($email,'email')
            ->press('signup')
            ->seeInDatabase('users',['username' =>  $username])
            ->seeInDatabase('user_profiles',['email'    =>  $email])
            ->see("Successfully");
    }

    public function testSignup_user_is_registered_before_same_email_case(){

        $userRepo = new UserRepository(new User(),new UserProfileRepository(new UserProfile()));

        $user = $userRepo->getUser(1);

        $this->assertInstanceOf(User::class,$user);

        $this->visit('signup')
            ->type(str_random(16)."yousa",'username')
            ->type(str_random(16),'password')
            ->type($user->profile->email,'email')
            ->press('signup')
            ->see("Error");
    }

    public function testSignup_user_is_registered_before_same_username(){

        $userRepo = new UserRepository(new User(),new UserProfileRepository(new UserProfile()));

        $user = $userRepo->getUser(1);

        $this->assertInstanceOf(User::class,$user);

        $this->visit('signup')
            ->type($user->username,'username')
            ->type(str_random(16),'password')
            ->type(str_random(16)."yousa@gmail.com",'email')
            ->press('signup')
            ->see("Error");
    }


}

if you need more Classes to be shown, Let me know.

kodemania started a new conversation Risky Test PhpUnit

Hello guys

Could you help me with risky test. How to write code which passes completely and avoid risky tests.

Regards

25 Apr
3 years ago

kodemania started a new conversation How To Completely Pass PhpUnit Risky Test

Hello fellows

I hope you guys are doing well, I was facing a bit difficultly in passing phpunit tests.

Let me explain my code

SignupController

class SignupController extends Controller
{

    /**
     * @var UserRepositoryInterface
     */
    private $repository;

    /**
     * @var RedirectServiceInterface
     */
    private $redirectService;

    /**
     * @param UserRepositoryInterface $userRepo
     */
    function __construct(UserRepositoryInterface $userRepo,RedirectServiceInterface $redirectService){
        $this->repository = $userRepo;
        $this->redirectService  =   $redirectService;
    }

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return view('auth.signup');
    }


    /**
     * Signs up New User to Our System.
     *
     * @param SignupRequest $request
     * @param RegistrationServiceInterface $registrationService
     * @param UserRepositoryInterface $userRepository
     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
     */
    public function doSignup(SignupRequest $request, RegistrationServiceInterface $registrationService, EmailServiceInterface $emailService, UserRepositoryInterface $userRepository){
        try{
            $newRegisteredUser = $registrationService->registerUser($request->all(),$userRepository);

            $emailService->sendWelcomeEmail($newRegisteredUser);

            $messageLangKey = 'auth.welcome';

            return $this->redirectService->redirectToSignup("successMessage",$messageLangKey);
        }
        catch( Exception $e ){

            $logger = new LoggerService();

            $logger->logException($e,"emergency");
        }
    }
}

RegistrationService class

class RegistrationService extends BaseService implements RegistrationServiceInterface
{
    /**
     * Register New User to Repository
     *
     * @param array $columns
     * @param UserRepositoryInterface $userRepository
     * @return mixed User Model
     * @throws Exception
     */
    public function registerUser(array $columns,UserRepositoryInterface $userRepository)
    {
        $userRepository->create($columns);

        return $userRepository->getUser($userRepository->getInsertedUserId());
    }
}

Email Service Class

class EmailService extends BaseService implements EmailServiceInterface
{

    /**
     * Sends Welcome Email to new registered User
     *
     * @param UserModelInterface $user
     * @return mixed
     */
    public function sendWelcomeEmail(UserModelInterface $user)
    {
        Event::fire(new UserSignedUp($user));
    }
}
<?php

namespace App\Repositories;

use App\Contracts\Models\UserModelInterface;
use App\Contracts\Repositories\UserProfileRepositoryInterface;
use App\Contracts\Repositories\UserRepositoryInterface;
use App\User;
use Exception;
use Illuminate\Support\Facades\Hash;

class UserRepository extends BaseRepository implements UserRepositoryInterface{

    /**
     * @var User Model Object
     */
    protected $model;
    /**
     * @var UserId
     */
    public $userId;

    /**
     * @var UserProfile Model Object
     */
    protected $profile;

    /**
     * UserRepository constructor.
     *
     * @param UserModelInterface|User $user
     * @param UserProfileRepositoryInterface $profile
     */
    function __construct(UserModelInterface $user, UserProfileRepositoryInterface $profile){
        //Parent::__construct($user);
        $this->model = $user;
        $this->profile = $profile;
    }
public function create(array $columns)
    {
        $this->model->username          =   $columns['username'];
        $this->model->password          =   Hash::make($columns['password']);
        $this->model->activate_token    =   Hash::make($columns['email'].str_random(8));

        if(! $this->model->save() ){
            throw new Exception("Error In saving User to Database");
        }

        $this->profile->createUserProfile(array('email' =>  $columns['email']), $this->model);

        $this->userId = $this->model->id;
    }
}

Event Listener

class SendWelcomeEmail implements ShouldQueue
{

    private $mailer;

    /**
     * Create the event listener.
     *
     * @param Mailer $mailer
     */
    public function __construct(Mailer $mailer)
    {
        $this->mailer = $mailer;
    }

    /**
     * Handle the event.
     *
     * @param  UserSignedUp  $event
     * @return void
     */
    public function handle(UserSignedUp $event)
    {
        $user = $event->user;
        $this->mailer->queue('auth.emails.welcome',['user' => $user],function($m) use ($user){
            $m->from('noreply@ismartz.com','Ismartz.com');
            $m->to($user->profile->email, $user->username)->subject('Please Activate your Account');
        });
    }
}

Now This is test I am performing

<?php

use App\Repositories\UserProfileRepository;
use App\Repositories\UserRepository;
use App\Services\RegistrationService;
use App\UserProfile;
use App\User;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Hash;

class SignupTest extends TestCase
{
    use DatabaseTransactions;
    /**
     * A basic test example.
     *
     * @return void
     */
    public function testSignup_process_fresh_user()
    {
        $username = str_random(16)."yousa".time();

        $password = str_random(16);

        $email = $username."@gmail.com";

        $this->visit('signup')
            ->type($username,'username')
            ->type($password,'password')
            ->type($email,'email')
            ->press('signup')
            ->seeInDatabase('users',['username' =>  $username])
            ->seeInDatabase('user_profiles',['email'    =>  $email])
            ->see("Successfully");
    }

    public function testSignup_user_is_registered_before_same_email_case(){

        $userRepo = new UserRepository(new User(),new UserProfileRepository(new UserProfile()));

        $user = $userRepo->getUser(1);

        $this->assertInstanceOf(User::class,$user);

        $this->visit('signup')
            ->type(str_random(16)."yousa",'username')
            ->type(str_random(16),'password')
            ->type($user->profile->email,'email')
            ->press('signup')
            ->see("Error");
    }

    public function testSignup_user_is_registered_before_same_username(){

        $userRepo = new UserRepository(new User(),new UserProfileRepository(new UserProfile()));

        $user = $userRepo->getUser(1);

        $this->assertInstanceOf(User::class,$user);

        $this->visit('signup')
            ->type($user->username,'username')
            ->type(str_random(16),'password')
            ->type(str_random(16)."yousa@gmail.com",'email')
            ->press('signup')
            ->see("Error");
    }
}

How can I make this code pass test with green. Any Suggestions

kodemania left a reply on Organising Controllers

I am new with laravel and currently developing a big project with laravel (big according to me). But I know it gonna be alot of code in that project. I came up with some simple code management model. On top I have controller, controller uses services to perform any task like EmailService for sending emails or registration service for registering new use etc etc. Services uses jobs or events to basically do the dirty work. For database Excess I have use Repositories in services class. Like Services will be getting data from repositories and returning to controller for rendering views. Repositories will access models. The End. I hope this will help you or someone else. :)

kodemania left a reply on Error: Target [xxx] Is Not Instantiable.

Better make a console command which generates ModelNameRespository and its ModelNameRespositoryInterface. it will be helpful and time saving.

08 Apr
3 years ago

kodemania left a reply on Blackfire Parse Did Not Find Expected Key Error

@Connor-S-Parks I have tried that also. I think it may be issue with some versions of packages or vagrant itself.

@DPJack It is really very helpful I will try it soon with given settings.

kodemania left a reply on Blackfire Parse Did Not Find Expected Key Error

haha well I am feeling happy for that :D maybe it is some system issue on my side. I will give it a try again with new installation. Could you tell me which version of laravel you are using ? @DPJack

07 Apr
3 years ago

kodemania left a reply on Repository Pattern In 5.0

Php don't have generic classes or generic interfaces like c#. So you have to make interface for every repo class of entity/model. Searching for some other way around. If I found any better way I will let you know :)

06 Dec
3 years ago

kodemania started a new conversation Blackfire Parse Did Not Find Expected Key Error

Hello Everyone,

I was just setting up homestead with blackfire and installed chrome extension and followed as in documentation. my .homestead.yaml file code is

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: E:\PhpProjects
      to: /home/vagrant/Code

sites:
    - map: laravel.dev
      to: /home/vagrant/Code/Laravel/public
    - map: laravel5.dev
      to: /home/vagrant/Code/Laravel5/public
    - map: laravel5app.dev
      to: /home/vagrant/Code/Laravel5App/public
    - map: alijan.dev
      to: /home/vagrant/Code/AliJan
    - map: adnan.dev
      to: /home/vagrant/Code/adnanProject
    - map: wordpress.dev
      to: /home/vagrant/Code/wordpress
    - map: classified.dev
      to: /home/vagrant/Code/ClassifiedAds/public
    - map: october.dev
      to: /home/vagrant/Code/october  

databases:
    - homestead
    - pnss
    - wordpress
    - classified
    - october

variables:
    - key: APP_ENV
      value: local

 blackfire:
     - id: 3f7e3ace-601d-4424-96b0-b6f85dcec82c
       token: 7e6ae7770326c52ee8c7f88fc142e233ab2e4077fac03b9dbcde14e46c5b2da3
       client-id: 104e4bf6-9961-4f13-94bb-fe4792a5ce21
       client-token: d79c1cdbe47f174b9a5e4647158e24d2e5a91a7581f5ae39f2c3fae161bec19c

# ports:
#     - send: 93000
#       to: 9300
#     - send: 7777
#       to: 777
#       protocol: udp

and when I used vagrant provision the following error appears

C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): did not find expected key while parsing a block mapping at line 2 column 1 (Psych::SyntaxError)
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:153:in `parse'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/psych.rb:129:in `load'
        from C:/Users/Kodemania/Homestead7/Vagrantfile:20:in `block in <top (required)>'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/v2/loader.rb:37:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/v2/loader.rb:37:in `load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/loader.rb:103:in `block (2 levels) in load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/loader.rb:97:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/loader.rb:97:in `block in load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/loader.rb:94:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/config/loader.rb:94:in `load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/vagrantfile.rb:28:in `initialize'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:689:in `new'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:689:in `vagrantfile'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:441:in `host'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:207:in `block in action_runner'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:33:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:33:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:428:in `hook'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:671:in `unload'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/bin/vagrant:177:in `ensure in <main>'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/bin/vagrant:177:in `<main>'

if I comment blackfire block everything work normal.

28 Sep
3 years ago

kodemania left a reply on Bio-metric Attendance System Using Laravel

I also want this in my project but if anyone know any library then please let me know

23 Jul
3 years ago

kodemania left a reply on Laravel Giving 500 Internal Error.

I can use 3rd option only which I used and still 500 internal error.

I have installed fresh copy of laravel 5.1 on this same server which worked. But when I deploy my app laravel app code it shows 500 internal error.

kodemania started a new conversation Laravel Giving 500 Internal Error.

Hello guys

I have an laravel app working fine on my local machine. I have just transferred it to my server ( Shared hosting ) and put everything on public folder in public_html and everything else in one step above public_html. The problem is now it shows 500 internal error on every route. I have changed .htaccess code to given code on documentation, folder rights to storage and bootstrap is set to 777. Nothing in error logs and also nothing in laravel log files. when I installed fresh laravel installation it worked on server as well. Tried updated code with my project but still 500 internal error.

Its .htaccess code

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

    RewriteEngine On

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

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

Code in my composer.json file

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "illuminate/html": "^5.0",
        "laravel/socialite": "^2.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

Searching from 3 days found no solution yet.

kodemania left a reply on Laravel 5.1 On Shared Hosting Not Working

@alainbelez Yeah its also one step above public_html just it was like on localserver

kodemania left a reply on Laravel 5.1 On Shared Hosting Not Working

I have laravel 5 app and I deployed it to shared hosting server via ftp. transferred all files to server and put public folder contain in public_html and all other files one step above public_html. Still getting 500 internal error.

code of my .htaccess file is

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

    RewriteEngine On

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

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

composer.json contains

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "illuminate/html": "^5.0",
        "laravel/socialite": "^2.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

kodemania left a reply on Laravel 5.1 On Shared Hosting Not Working

Having same problem and waiting for someone to have any solution to it.