Can I just copy/paste Laravel framework folder structure? - php

My website already have MVC architecture. I want to expand his capabilities by installing Laravel framework.
Can I just copy unzipped Laravel framework, so all folders and libraries are just copy/pasted. ?
I have VPS Ubuntu 12.04 and PHP 5.4.4

In which form your website has MVC architecture implemented ?
Is that through your plain PHP code or through some other framework ?
Laravel is implementing MVC architecture on its own way. In order to use that Laravel MVC capabilities, you will have to move all your logic inside Laravel.
UPDATE WITH SOME RESOURCES:
Official Laravel documentation
Laracasts - video lessons
Laravel IRC channel.
Good luck

The fact that you have used MVC does not mean that it will fit laravel's structure unfortunatelly. With different file structure, routing, controllers and models it wont work that way.
I dont know how advanced and expanded your page is, but you will probably re-write it laravel way.
Steps that you will need (assuming that you have some knowlege about laravel):
Prepare models for your existing database
Add routes for pages that you will need, create controllers for them using models
If you have used smarty templates, you can install smarty bundle for laravel, otherwise you will have re-write you templaets to blade (default laravel's templating engine)

Related

Using one laravel core for multiple application

I am a programmer who familiar with Java and .NET.
Now for some personal project, I want to host it to my shared hosting using PHP. I just learn PHP, and I select Laravel because I saw it very look like Spring MVC and ASP.NET I used already.
But I have a concern is that, each project will INCLUDE the laravel framework folder (in /vendor). So if I have multiple laravel projects (create by composer), I will have multiple laravel framework core file for each project. This is a kind of duplicated resources, reduce my disk space a lot.
Are there any solution for that? Example use one laravel framework core for multiple project. I mean the folder /vendor/laravel. I used Java Spring and ASP.NET and for these framework, we can store libraries of framework (.jar or .dll) in a folder, then reference it from projects.

Laravel Framework php

I've made an online store in php for school, and now my teacher wants this project to have a Laravel Framework. And I have no freaking idea how to do it. Are there any possibilities to implement this framework to my project, or my project to this framework, without starting from scratch? If yes, how should I do it?
irrespective, its going to involve a lot of rework. A lot also comes to down to HOW you've developed your original php app. Laravel is a Model View Controller framework. For starters all your routes (http redirects) are generally managed in a single file (web.php). Your views can be traditional php, however, Laravel gives you a good templating engine called Blade which allows you to shorthand code and keep code a lot cleaner. Models control your table relationships, controllers handle the functions/code/crud etc.
You will love how easy it is in most respects - especially the way eloquent data queries work etc. It can greatly reduce your code.
If your teacher wants you to LEARN Laravel specifically, I would say YES you will be starting over - however, your logic in the code should just need reworking rather than start from scratch.
There are heaps of posts around HOW to install Laravel (apache, virtual box, homestead etc) - once your ready, its super simple to create a new project and start building away... If you are new to MVC, you should do some tutorials first (e.g. laracasts or other).
Best of luck :)

Difference between laravel 5 and codeigniter 3

This may silly question. But I am going to start new project. I am quite confused which framework is best out of Codegniter 3 and Laravel 5.
What is the main difference between them.
Thanks in Advance
Right now, I personally prefer Laravel since it supports PHP7 unlike CodeIgniter (I still haven't read if CodeIgniter 3 supports PHP7). And based on personal experience, Laravel (through Eloquent) has "beautifully-written-codes".
Here are some references for you to check out: (I made sure to post both sides to not be bias)
https://www.codeclouds.com/blog/laravel-vs-codeigniter-a-difficult-choice/
https://www.clickittech.com/developer/laravel-vs-codeigniter-which-one-is-the-best-to-use
http://www.codeigniterhands.com/codeigniter-or-laravel
http://laravel.io/forum/07-08-2014-laravel-vs-codeigniter-a-difficult-choice
https://therightsw.com/codeigniter-vs-laravel-vs-yii-vs-cakephp/ (with grades for usability)
Each framework have their own features and capabilities, used during the development of application. Laravel is one of the highly used, open-source modern web application framework that designs customized web applications quickly and easily.Laravel is used not only for big project but also best to use for small project.
Best framework in 2018
If you want a framework with exceptional performance, with nearly no configuration, not using cmd and not interested with large scale libraries and also your project is in small scale it's better to use codeIgniter.
CodeIgniter3 vs Laravel5
Both framework are good in there place.
Laravel made from multiple open source project which make laravel more efficient , reliable and secure.
Where, laravel used blade engine.
It used composer for package manager.
It provide unit testing.
It provide more security.
It provide beautiful redis queue front portal called laravel horizon.
Disadvantage : laravel used predis which is slower, because it is written in php.where phpredis is more faster, but laravel 5.* Don't support it.
I will recommend you to use Laravel beacuse of:
Built in authentication
Awesome migrations
Artisan commands to do anything in your project
Built in pagination (It's took long in Codeigniter)
Eloquent (Very easy way to interact with your database)
Relationships
Routes
Easy API building
Easy debugging
Huge number of packages and libraries etc.

Admin Routes (Nested Controllers or Bundles)

I'm studying the Laravel 3, 1 week ago, but didn't understand everything about the routes.
My main question is: how to create administrative routes?
In the video lessons from Jeffrey Way (Tuts Premium), I could understand two things about it:
Nested Controllers (/application/controllers/admin/user.php)
Bundles (/bundles/user.php) - He did not say much about it.
Anyway, I noticed 2 things (obvious):
On both sides, I can have a route / admin / whatever.
But what the correct way?
I'm really very confused.
Laravel bundles are for developing modular code that you can reuse from application to application in Laravel. The Bundle itself is very much the same as the 'application' directory you have as standard in a Laravel install, allowing you to create modular sub applications within your project. I highly recommend you avoid bundles for the moment entirely and focus on learning the core functionality of Laravel.
For your needs, place your routes within your routes.php file within the application directory and nest them to your hearts content. This will serve your purposes fine. If you're not building/using bundles, you don't need to use bundle routes.
When you're comfortable with Laravels routing and you've built one or two apps you may well have an idea for a bundle that will help you develop your apps faster in the future. This is the time to start learning about bundle routing as it's the only way to link your application logic with your bundle and provide it with a URL schema.
Hope that helps.
Neither way is really right or wrong, the beauty of Laravel is that there are so many ways to achieve the same thing so it's up to the developer to choose what works for them.
Personally I started by using nested controllers as they're much easier to get up and running. I would however recommend making the move to bundles. If you plan on sticking with Laravel (and you should) then it would make sense to build a bundle that includes the auth and components you use in each project already setup. That way you just need install the bundle and you're good to go.

how to best structure application in symfony 2

I started using Symfony 2 after having experience with 5 php frameworks like Zend, CodeIgniter, Fuel, Yii and Cake. I am very confused on how to structure my project as better as I can. First of all I am confused in working with bundles. Bundles are some kind of modules used in other frameworks? Bascially I have my application and everything until now is stored in a bundles. If I want to make some helper functions and some libraries and abstract classes, I just make a new bundle for those?
See the Bundle Structure and Best Practices cookbook entry for basic ideas on the structure of a bundle.
I recommend having just one app specific bundle. I call it AppBundle.
Also, you don't have to have everything in bundles. Check this question for details.
Lots of other discussions on that matter:
Should everything really be a bundle on Symfony 2?
Confused with symfony2 bundles

Categories