avatar
Kuberdenis

May 15, 2024

1-click install for Laravel + Voyager

Get featured on Geeklore.io

Geeklore is in very early stages of development. If you want to help us grow, consider letting us sponsor you by featuring your tool / platform / company here instead of this text. 😊

Prerequisites

  • Apache2
  • MySQL/MariaDB
  • PHP
  • Git
  • Composer

Introduction

Hey, $user! Today I'll share with you how to install Laravel + Voyager with only "1-click". Well, you guessed it - it's a script. My script. There are many like it but this one is mine.

Anyway, for the ones who don't know what Voyager is - let me explain. Voyager is the ultimate admin panel for Laravel. I suggest you watch a quick video from DevDojo to get more understanding of why Voyager is a great ally to have on your side!

Only two things are required from you:

  1. Clone the script in directory of your choice (or wget it):
git clone https://github.com/47ontech/voyager_with_laravel.git
  1. Run it.

Walk-through

I will not be doing a full walk-through for each line, yet I want to highlight some key points.

Variables

The Variables "section" is pretty straight forward. The only thing I want to pay attention here is the following:

DBPASSWORD="$(openssl rand -base64 12 | tr -d \"=/\")

Sometimes when the password add the special characters '=; /; \;' the whole script crashes 🤷.

Voyager Install and Config

The word 'frustrated' would not be enough to express how I felt until I found where the problem is. I need you to remember the following line:

find /var/www/$SITE/laravel/config/app.php -type f -exec sed -i "168i TCG\\\\Voyager\\\\VoyagerServiceProvider::class," {} \;

So what's the deal with it? Well, when you try to escape a character, usually you do one simple back-slash (\). However, when you want to escape a back-slash you have to enter 3 of these little guys. As a 'not-senior' guy, the debugging part was hell for me and I purged a lot of my time before I found the real problem. Anyway, when you want to escape \ , just turn it into \\\\ .

Permissions

If we don't setup the permissions of our Laravel project, it will throw exceptions at us and we don't want that. We setup permissions.

"That's all, Folks"

thatsallfolks

Yup, that's all. I hope you find this handy. Bye!

Latest Comments

  • No comments yet.

More From This User

5 0 1885
Read Now
10 0 6637
Read Now
1 0 57
Read Now
3 0 29
Read Now
0 0 23
Read Now

© 2024 Geeklore - DEV Community RPG

Facebook Twitter Linkedin Instagram

Campaign Progression Updated!