1

I have a shared hosting where I'd like to develop a couple of projects to learn better Laravel. I started few days ago to go deeper into the MVC pattern and I installed Laravel 5.4 on a domain of that shared hosting which provides an installer.

Since it's PHP, I guess the answer to my question should be: "Yes, you can do all the stuff manually instead of having it automatically done by artisans commands"; what I'd like to know if it's really true or if I could get stuck at certain point of my project.

Today, for example, I wanted to learn about Laravel's authentication and I saw the Laravel's default user migration file. As said, I don't have SSH access on this hosting and I can't use artisans commands so I wanted to create the table manually but my doubt was: what are the real parameters of each columns? My problem particularly regarded the rememberToken() function. After a research I found the function in Blueprint $this->string('remember_token', 100)->nullable(); and I suppose it's a varchar(100).

To sum it up, can this approach work for a small project or is it like having a gun at the head ready to shot when you less expect it?

This question comes from a really newbie in Lavarel and in general in frameworks, so it can appear stupid to the more experts but since I didn't find any answer to a similar question I decided to ask it.

Thanks

P.S.: I tried to install Homestead to have a local environment and successively upload the files to the server, but on Windows the installation is quite a pain; I got stuck at the $ homestead up call that returns me bash: homestead: command not found. Since I'm not really familiar with CLI, I thought to learn Laravel first and then go deep into CLI also to use all its power, of course if the Laravel's usage without CLI is possible.


The question has been marked as possible duplicated of: Can I Install Laravel without using Composer? but I'm asking if I can use Laravel without CLI, not if I can install Laravel without Composer (since, as I mentioned, Laravel is perfectly installed and fully working on my shared hosting).

Brigo
  • 1,086
  • 1
  • 12
  • 36
  • Pretty sure you'll need a VPS. Laravel stores views in php format the `/storage/views` folder: those might be helpful in a front-end transcription to raw php. – admcfajn Jul 25 '17 at 18:06
  • Here's your answer: https://stackoverflow.com/questions/15940140/can-i-install-laravel-without-using-composer – admcfajn Jul 25 '17 at 18:09
  • Possible duplicate of [Can I Install Laravel without using Composer?](https://stackoverflow.com/questions/15940140/can-i-install-laravel-without-using-composer) – admcfajn Jul 25 '17 at 18:10
  • With composer, setting up Laravel on windows is not quite difficult, check the docs [here](https://laravel.com/docs/5.4). With Laravel set up on your local machine, you can run artisan commands on it and upload the generated files to your server, same for database. It's crude but looks like your best bet – Victor Anuebunwa Jul 25 '17 at 18:13
  • @admcfajn I didn't get the point about views. Anyway my problem is not about installing Laravel without Composer: as I mentioned in the post, Laravel is already installed and perfectly working on my shared hosting. My problem is that I don't have SSH access. – Brigo Jul 25 '17 at 19:12
  • @avonnadozie Yeah, that was the idea while I was trying to install Homestead; I'll try maybe to manually install Laravel as you suggested. Anyway, in your experience, could be possible using Laravel without SSH access? – Brigo Jul 25 '17 at 19:15
  • Yes it's possible but you'll lose the fun – Victor Anuebunwa Jul 25 '17 at 19:21
  • 1
    @brigo Laravel takes templates written in blade syntax and then saves them as raw php in other files... You'll find those files in the `project_root/storage/framework/views` folder. And yes, I understand your question. Please check out my link above. I think it has a lot of relevance to your problem. – admcfajn Jul 25 '17 at 19:22
  • @admcfajn I probably don't get your point at 100% 'cause I never developed with Laravel. You mean that, apart for `artisan` commands, that based on madpoet's answer I found out I can run also from the code, I would need SSH access anyway 'cause at a certain point I should launch `composer` commands? Can you explain me, please? 'Cause I neither ever used Composer. All this concepts are new to me and I guess I'm a bit confused. Thanks! – Brigo Jul 25 '17 at 19:41
  • @brigo Sure, full-disclosure, I'm not the utmost authority on these things. I only ever use composer for package management (to download the packages I want to use for my installation). Once composer has done the work, you should be able to put the db & app on your server and have it run. Do your command-line things (bootstrapping, migrations, etc) locally, then send it up to your server. I haven't actually tried this, I usually build from command-line/ssh. You'll need copy the files & db to your server, then edit the .env to connect to the database on your server. – admcfajn Jul 25 '17 at 19:49
  • @brigo I found this interesting: http://creolab.hr/2013/03/removing-the-public-segment-in-a-laravel-4-app/ – admcfajn Jul 25 '17 at 19:58

1 Answers1

2

Sure you can use and maintain your laravel project without the artisan command and composer but eventually you'll realize that you're spending too much time on stuff that would take only a few seconds with these tools.

You can always run artisan commands inside controllers.

madpoet
  • 1,023
  • 11
  • 28
  • This is a really good tip! Didn't know I could run `artisan` commands inside controllers. For this part the problem could be solved like this but you mentioned `composer` as @admcfajn did. I then ask you as well: when I would need to use `composer` (and then would get crazy without SSH access)? These are all new concepts to me. Thanks! – Brigo Jul 25 '17 at 19:46