I am fairly new to laravel, I have a project at hand with multi-tenancy needs. I saw this package https://github.com/laraflock/multi-tenant and I was interested in it until I saw it only allows for a database per tenant. I want to achieve a single database for the whole application separating tenants by ID. I already have my database structured. Is there anyone with an opinion on how best to achieve that with Laravel 5.1? I have seen so much on 4.2 but since I have not tried 4.2, I just skipped.
Related
I have been developing in Codeigniter for awhile now. I have recently read that Laravel is currently the most modern and best framework. I am interested in learning it for my next project. I'm hoping that someone could help to answer some questions that I have about Laravel.
1) How would I host it? Laravel seems to rely on composer a lot and that requires a terminal. For CI, I just download a folder and load it up to my Webserver and I can run it.
2) Dev environment. I have been using Netbeans that is connected to my server and it can push updates instantly. I want to connect it to git soon for some versioning as well. Is it the same for Laravel? How would I update it?
Same here, I have been developing Applications in Codeigniter 2,3 for past 5 years and now I am learning Laravel and have starting making beginners level application in Laravel Here are my findings which might help you
Difficulties
For Codeigniter Developer, Instantly playing everything by using router is kind of difficult. Although router is used in codeigniter as well
Installing and setting up Laravel seems like a tricky and very lengthy job especially the use of composer which is an extra thing as compared to codeigniter which is just download and uncompress or copy paste installation procedure.
But Why Laravel?
Object Relation Modeling - Eloquent ORM
We can easily create relations and joins with query builder or active records in codeigniter but to enforce referential integrity in database, we have to write triggers in our database or define relations. Luckily in Laravel the relations are made with one line of code and does a lot of job. Whereas in Codeigniter that's a lot of manual code writing.
Integration of off the self Packages.
There are thousands of developed packages readily available on packagist, which is a repository composer uses to download software packages. You just have to write one or two lines of code at composer terminal and it does all the rest, create models, controllers, views. All you have to do is include them or change the styling as per your layouts.
Think of Laravel as a PHP framework for extremely lazy developers who want to write very less and re-usable code and do lot of work from it.
Learning Resources
Laravel 5.2 from Scratch that's the one I started with, excellent course and Modern Web Development with Laravel
Uploading on Shared hosting
Click here for tutorial
I am a student and I'm making a project, an application which will show data to users on web end and also on android application. but I am confuse which one to choose for backend development, Laravel or Lumen ? My application will have signup function and displayed data from mysql against search queries. There will be 4 to 5 tables and multiple columns in each table. also images to show. So which one I should choose?
From what you have described so far Laravel seems like a perfect fit. Start off with laravel, if you need more speed and a framework focused towards building web services give lumen a try. If you haven't worked with PHP or any other backend app before, go with vanilla PHP.
Goodluck with the app!
If you only need to build an API use Lumen, otherwise Laravel
Well, I recommend Laravel rather than Lumen (Frankly speaking, CI framework may be more suitable, which is simpler and friendly to new user). About 1.5 years ago, I experienced the same dilemma, just like you. For lacking of enough document, I have to migrate my project from Lumen to Laravel when I came across some problems.
I'm looking to recreate some internal systems using Laravel 5.3 as the internal systems need rebuilding. I am still fairly new to Laravel as we have used a bespoke framework based on PHP 4 for a few years, which is starting to show its' age.
The current setup makes use of having a users table for each application, which from my knowledge is not efficient as the userbase is shared (open to all employees).
Would I be right in thinking that I can set up a Lumen application, with a database of users, and then use Laravel Passport to make it an OAuth2 server? Say for example, passport.company.com and then new users are registered via this application.
Therefore, another two applications using Laravel i.e. CRM and CMS can then use the Passport system for authentication, rather than having to create users tables for each application?
If this is on the right lines, or there are better alternatives, I would be grateful to hear your feedback.
Thanks!
Edit: It appears that I'd need Laravel for all applications and not Lumen, after reading further into it.
I'm still curious as to know if I am on the right track however?
I installed entrust on my laravel 5.1. I'm wondering what's the best way to create your first roles?
I see some people creating them with routes but this doesn't seem like a clean way to me. Should I just seed my first roles directly into my database or is there a better way?
In my opinion, this is up to personal preference. As you mentioned already, using a database seeder is a perfectly reasonable solution.
If you really want to contain and separate the code that initializes the roles/permissions, or anything else you need in your application, you can also opt to create a custom Artisan command within Laravel that does the initial setup tasks you need to do. With this method, you can separate your initial production set-up and you can still utilize your database seeders without having to modify them for testing purposes.
Resources:
http://laravel.com/docs/5.1/artisan#writing-commands
https://laracasts.com/lessons/commands-101 (Laravel 4 but still good)
I have been enjoying working on Laravel for a while now, and am planning to move a fairly large project to Laravel 5.
The new project has fairly large database with numerous tables, and it would take considerable amount of time build migrations, models and controllers individually.
Has anybody worked on this before? What is the best way to go about it?
I have used this great extension to generate migrations as of now - but still for a 200+ tables, it would take quite a long time to do the rest.
Try this one:
https://github.com/reliese/laravel
Reliese Laravel is a collection of Laravel Components which aim is to help the development process of Laravel applications by providing some convenient code-generation capabilities.
How about this: http://packalyst.com/packages/package/ignasbernotas/laravel-model-generator
Model generator Laravel 5 model generator for an existing schema.
It plugs into your existing database and generates model class files
based on the existing tables.
For migrating models and controllers just use artisan commands, you can't get around it any easier than that. For the migrations I can suggest trying to use the following package:
Laravel Database Exporter
It will export your existing DB schemas as Laravel migrations. My suggestion is based on the assumption that you are using MySQL as your RDBMS, because the package I suggested only works with that.