Welcome to a series of Deploying a Laravel Application.
Laravel applications are deployed on many sites.
I will be taking you through on how to deploy a laravel application which has a database and to be specific, Postgresql Database.
defmodule Solution do | |
#Enter your code here. Read input from STDIN. Print output to STDOUT | |
end | |
array_length = IO.read(:stdio, :line) | |
array = IO.read(:stdio, :line) | |
array_length | |
|> String.trim | |
|> String.to_integer |
sudo chmod -R a+w storage/app | |
sudo chmod -R a+w storage/framework | |
sudo chmod -R a+w storage/logs | |
sudo chmod -R a+w storage/cache | |
sudo chmod -R a+w bootstrap/cache | |
sudo chmod -R a+w .env | |
sudo chown -R www-data storage/app | |
sudo chown -R www-data storage/framework |
Listing items in tables is one of the ,ost essential while building dashboards. Datatables https://datatables.net/ Add advanced interaction controls | |
to your HTML tables which we mostly do on the client side. Using the same approach to load large rows of data from the database | |
always becomes slow as the data grows bigger and bigger untl at some point the datatable break. This is a major reason to | |
consider using datatables from the start of your development to avoid such. Thats what we are goint to do. | |
Create a new laravel project composer create-project --prefer-dist laravel/laravel datatable-test | |
change the .env for database connections | |
DB_CONNECTION=mysql | |
DB_HOST=127.0.0.1 | |
DB_PORT=3306 | |
DB_DATABASE=datatables-test |
import java.util.Random; | |
import java.util.Arrays; | |
public class LinearArray | |
{ | |
private int[] data; // array of values | |
private static final Random generator = new Random(); | |
public LinearArray( int size ) | |
{ | |
data = new int[ size ]; | |
for ( int i = 0; i < size; i++ ) |
Replace your app\Exceptions\Handler.php render() function with this | |
/** | |
* Render an exception into an HTTP response. | |
* | |
* @param \Illuminate\Http\Request $request | |
* @param \Exception $exception | |
* @return \Illuminate\Http\Response | |
*/ | |
public function render($request, Exception $exception) | |
{ |
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Auth; | |
use Config; | |
public class TestController : ApiController | |
{ | |
[HttpGet] | |
public IEnumerable<Student> Students() | |
{ | |
return StudentCrud.GetStudents(); | |
} | |
} |
public class Student | |
{ | |
public Guid Id { get; set; } | |
public string Name { get; set; } | |
public int Marks { get; set; } | |
} | |
/////// | |
public class StudentCrud |
use Illuminate\Support\Facades\Schema; | |
public function boot() | |
{ | |
Schema::defaultStringLength(191); | |
} |