Jump to content

Hello Php Freaks!


SprigusK

Recommended Posts

Hello everyone! I'm not sure how active this site is, but I was told I can get a lot of help here from expert PHP people. My name is SprigusK, but you may call me Sprig. I have been interested in coding since my days back when I used myspace. All the layouts and things you could do blew my mind. I started my coding life by getting a free website from a website that allowed me to downgrade from their template service to raw coding. Anyways, i continued to learn how to make awesome webpages using Html/CSS. I could make any page/site look totally awesome, but that Login button wasnt going to ever work. I went on a real life hiatis for many years and I'm trying to get myself back into coding and learning much more Back end then Front. I am currently working on a New Website using: Html/Css/Js/and Php. I'm hoping to find some helpful people here to help guide me in the right direction. For the sake of trying to know my knowledge. Let's pretend I NEVER seen a php code in my life. Now this isn't true as I've built a registration system on my site using a tutorial and it works great, but it is more likely because i followed the Tutorial rather then knowing why it works. I can sort of Read what is happening in the code but not sure i understand why. Anyways, I look forward in finding new friends and helpful mentors in my journey to master coding.

+1 if you took time to actually read that. :D

Link to comment
Share on other sites

A lot of things have changed in the PHP world since you last might have looked at it.  Beware of old PHP tutorials, especially ones that look simple.  Web applications are not simple.  There are 2 top notch PHP web application frameworks.  My advice to you would be to pick one or the other, and concentrate on learning how to develop your application with the framework.

Those frameworks are:

Either framework will allow you to create whatever type of web application you desire. I've used both in commercial ventures, and there are many developers and associated companies and related projects that depend on each of them.  There is ample documentation, tutorials and both free and paid courses that will help you learn either framework.

Of the 2, I prefer Symfony, because I prefer the Symfony ORM (Doctrine) and template language (Twig) over the alternatives (Eloquent & Blade) in Laravel, but Laravel is often the choice of developers for its ease of entry and opinionated base components (it basically gets you running with things like users/security out of the box, and has a bunch of autowiring that at least initially, can hide the complications of dependency injection.  

Each framework makes heavy use of dependency injection, which is a highly favored design pattern for interconnecting class libraries.

The other advice I would have is to get yourself up and running with these things:

  • git/github
  • visual studio code
  • docker

These are great tools, used by the vast majority of professional web developers.  (For PHP, the leading commercial editor is PHPStorm, about and for which you will find a lot of material, but if you are looking for a free option, then go with visual studio code).  

You can find some free project jumpstart resources on Youtube by searching for "Symfony 5 tutorial"  and "Laravel 8 tutorial".    

 

Link to comment
Share on other sites

I actually started to use laravel in like 2016 when I attempted to build a Virtual Pet site, and I loved it. I had a programmer help setup a github and he helped setup some program that pushed the project live with SSH? or Something I forget. I designed the site locally and pushed it live. I have no clue how to do any of that stuff, I'm pretty much new to a lot of things and was told learning PHP purely first was a better choice then start with a framework. Do you think someone who doesn't really understand php enough should start with a framework? I'm sort of building a site similar to a Pet site now but not really. I haven't gotten too far in my development to change the setup yet, but pure php would help with structure learning and things.

Link to comment
Share on other sites

On 11/10/2021 at 4:23 PM, SprigusK said:

I actually started to use laravel in like 2016 when I attempted to build a Virtual Pet site, and I loved it. I had a programmer help setup a github and he helped setup some program that pushed the project live with SSH? or Something I forget. I designed the site locally and pushed it live. I have no clue how to do any of that stuff, I'm pretty much new to a lot of things and was told learning PHP purely first was a better choice then start with a framework. Do you think someone who doesn't really understand php enough should start with a framework? I'm sort of building a site similar to a Pet site now but not really. I haven't gotten too far in my development to change the setup yet, but pure php would help with structure learning and things.

Yes, stop what you are doing, and create a new Laravel project.  Then concentrate on porting whatever actual logic you've created to your Laravel app.  Along the way you will start to pick up PHP again, just by having to figure out how to write the code you need.  

For github, figure out how to login to your old account.  Take a look in there to see what you have.  Github now allows free accounts to have private repos, which is what of course you want for your projects at this juncture.

Figure out how to install git on your workstation.  If you let me know what OS you are using, I can push you in the right direction as to what you need to install.  Once git is installed, visual studio code sees that, whenever you open a project directory that is already "git initialized"

Yes, you need an ssh key, and to set up your workstation and github account to use it.  This might sound intimidating, but it's documented with easy to follow directions by Github.   Just follow the path for your workstation OS.

Really, the use of ssh is a basic ingredient for most all web administration at this point, as it provides the means to securely connect to servers across a public network.

What the programmer did for you was basically this, and you can easily do the same with your new laravel app

  • Let's say your project directory is named "newpets"
  • Set a few global git settings for your workstation
    • git config --global color.ui "auto"
    • git config --global user.name "Your Name"
    • git config --global user.email "email@domain.tld"
  • In a console in the newpets directory/folder
    • git init
  • At that point the project will be a local git project, where you can use all the features of git (making branches, committing files, merging branches together etc.)  As I mentioned, Visual Studio Code will also help you with these functions if you don't understand them, as it's "git aware" and will show you git state information about your project files.
    • You have to understand how to add files to the git stage using "git add" and then to commit them.
    • You want to understand what a .gitignore file is, make one and add it to your project, to hide files and directories in your project that you don't want committed.  Quick PHP tip: you do want to version both your composer.json and composer.lock, but you don't want anything in the /vendor directory.  There's a helpful site called gitignore.io which you can use to get boilerplate.  Here's the boilerplate gitignore they provided for the use of the Visual Studio Code, the php composer dependency management tool and Laravel.  
# Created by https://www.toptal.com/developers/gitignore/api/composer,visualstudiocode,laravel
# Edit at https://www.toptal.com/developers/gitignore?templates=composer,visualstudiocode,laravel

### Composer ###
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock

### Laravel ###
node_modules/
npm-debug.log
yarn-error.log

# Laravel 4 specific
bootstrap/compiled.php
app/storage/

# Laravel 5 & Lumen specific
public/storage
public/hot

# Laravel 5 & Lumen specific with changed public path
public_html/storage
public_html/hot

storage/*.key
.env
Homestead.yaml
Homestead.json
/.vagrant
.phpunit.result.cache

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# Support for Project snippet scope
!.vscode/*.code-snippets

# End of https://www.toptal.com/developers/gitignore/api/composer,visualstudiocode,laravel

So once you get the project going, and you are adding and committing changes to your local git, at the point you want to setup github as your remote, you simply need to create a project of the same name, set your local git remote, and push whatever branches you want in github.  By default, and for most people starting out, that can just be your "master" branch.

I recently gave a presentation on git developer basics, and here is the slideshow from that presentation, if you want to look through it.  I am at this point repeating a lot of what I covered in the presentation, so there are slides on most of these topics.  Just beware the code snippets with funky quotes, if you try and copy and paste from the pdf.

I don't know how long I'll leave the pdf available in dropbox, so if you want to check it out, download it sooner than later.

Link to comment
Share on other sites

Good evening Sprig 🙂 I am like you and manny others here "of the old school". I was new here in February 2021.I have bean away from Programming and the life inside the IT univers for more than 10 years. So i know exactly what you are talking about. When i started programing again i thought i would be a easy match. I was so wrong. It was like waking up from coma and have to learn every thing up up up and up again. Good luck Sprig, and welcome 🙂 

Leon (Norway)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.