Yii2 Framework - Custom Installation Template - php

When I access to Yiisoft account on Github:
https://github.com/yiisoft
I see 3 pinned repos: Yii2, Yii2-app-basic and Yii2-app-advanced.
I know When I run the command:
composer create-project [template] [project-name]
I can create a project using one of installation templates. Also I know on the composer.json on this templates is set yii2 framework and yii2 bootstrap as dependencies, so they get downloaded.
What about if I want to create my own installation template, is there a guide how to do it?. I know it would not be that productive but just wondering out of curiosity.
UPDATE
I have noticed that just a couple hours ago this page was published:http://www.yiiframework.com/doc-2.0/guide-tutorial-start-from-scratch.html
but still it is based on the basic installation template, not a totally custom one.

Related

Laravel Mix hot reloading inside the package

I've been trying to create an admin panel for Laravel (I know, there is a Laravel Nova now for 99$ for a single site) and all I've been doing is trying to build all of this functionality on top of laravel/laravel package.
What I've seen with Nova, is that it is a separate package, which is seamlessly integrates with Laravel by simply dragging and dropping the folder with Nova to the root directory of the Laravel application.
Even though, I have an idea (and a little bit of experience) on how to replicate (and maybe even enhance Nova functionality), I've no idea on how to make HMR working with the package.
Let's say my package name is Niva (just an example), with the folder named niva placed inside the Laravel folder. The webpack.mix.js is the same as in the Laravel Horizon package.
So far, I've no problems with accessing routes defined in the package, I'm able to load views from the package by accessing specified route, even authentication works just fine. However, I have to manually compile the package first, then publish the assets, and only then I can view the changes I've made to the source code.
Example package base routes:
Web: _http://localhost/niva (Only need for HMR to be present here)
Api: _http://localhost/api/niva
Example package base directories and files:
Root: /var/www/localhost/niva
Public: /var/www/localhost/niva/public
Resources: /var/www/localhost/niva/resources
Webpack: /var/www/localhost/niva/webpack.mix.js
What I'm asking about is: is it possible to enable HMR for the package, and how it should be done?
P.S. I've been thinking of symlinking the public directory from the package to the public vendor/niva folder, but still no result (I'm pretty sure I'm missing something here).

Configure Laravel project in Netbeans 8.2

I am using Netbeans 8.2 and I want to use it for Laravel project. I know it is possible to create a Laravel project in Netbeans without going to cmd (This is what I am trying to achieve) I have followed these steps to create a Laravel project
Install Composer on your system
Installer the Composer plugin for Netbeans (It's in the plugins menu, under the PHP category).
New Project > PHP Application
Go though the wizard, and setup your project. the last step should be named Composer
In the last step,search (under Token:) for laravel
Select laravel/laravel: The Laravel Framework. and move it to the selected frameworks on the right
Click Finish, and you're Done!
Everything went fine! and I am able to create a laravel project from wizard unfortunately as I can see some folders and files (which are always there in Laravel ), I have spend some some hrs searching for a guide on how to integrate Laravel in Netbeans without success. Please help what is wrong with my steps?
My Netbeans project structure

What files and folders to copy when moving Laravel Project

I'm kinda still finding my way around the Laravel development framework. I want to use a Sample Project Here for my learning
Now the project was done in Laravel 5 and i'm trying to use the Latest 5.5 Laravel.
How do i go about this and what files and folders do i have to copy to my Laravel 5.5 project to get this working.
The file and code structure has changed quite a lot from Laravel 5.0 to Laravel 5.5.
If you are wanting to use that project on Laravel 5.5 then you would need to go through the update process for each version until you reached Laravel 5.5. These can all be found in the Laravel documentation for the respective version.
An easy, and better approach, would just be to incorporate this into your project manually.
SB Admin is just a theme based on Bootstrap and so you can just incorporate it into your app as you would Bootstrap.
You can download the source for SB Admin here - https://startbootstrap.com/template-overviews/sb-admin/
You can also check out the source on GitHub if you need more of an idea on how to use it on specific pages - https://github.com/BlackrockDigital/startbootstrap-sb-admin
If you really want to use that project to learn Laravel then you can. As you're still new to Laravel, I wouldn't bother updating it (you'd likely be in over your head).
To get started with the project, just follow the instructions on their repo - https://github.com/start-laravel/sb-admin-laravel-5:
Clone the project git clone https://github.com/start-laravel/sb-admin-laravel-5.git
Switch into the newly created folder
composer install to install Laravel and the required dependencies
npm install
bower install

Laravel: Working with a 3rd party bundle

This is a basic best practice question.
I started my first project using the Laravel framework. I just recently added the L4withSentry bundle to my laravel project. I followed the setup steps and everything is up and running fine, but I noticed that all of the code that's running for the site is running from the vendor folder of my project even though I published all of the views and assets.
Should I leave all of the code in the vendor folder and customize it there? I'm under the understanding that if I update composer and any of the vendor files need to be updated I'll lose all of my code. Should I move the controllers into my app folder?
packages should stay in the vendor folder. the sentry package makes it actually easy to customize or set your own model outside of sentry, so you don't have to fiddle with vendor packages.
if you really have to change some behaviour in a vendor package, you'd create a new class extending that vendor package's class.

Zend Framework 2 and source code repository

We created a ZF2 project with skeleton app and it works fine for a simple test application. Now we are working on a real project. My question is what we should store in the repository (SVN), the whole project structure or just the new source code? ZF2 comes with a vendor directory which is almost 31MB in size (which has the ZF libraries). Should we store the whole vendor folder in SVN?
This is the first time we are using PHP and ZF so are not clear in how we will deliver the complete project to production from SVN. Also what is the build process if at all exists. Any clues/links to "ZF2 project packaging" is appreciated.
No, don't include dependencies in your repository! Putting your dependencies under version control doesn't do any good, it just blows up your repo for no reason.
You want to add the skeleton to your repository and your own library but definitely not the framework or any other dependencies.
The way to go is to use composer for dependency installation and some kind of build tool like Phing to automate installation of your project.
See the relevant chapter on phptherightway for more information on how to build your application.
The most simple build process doesn't even need a build tool
checkout your project from SVN/git
run php composer.phar install to install the needed dependencies (defined in your composer.json)
But most probably you want to do some more stuff like setup up the environment, deleting some files, etc.
A word about ZF packages. They're not available from packagist but you can install them with composer anyways. You just have to add the dedicated repository to your composer.json as described here: http://framework.zend.com/downloads/composer

Categories