Miscellaneous concepts and libraries for Laravel based development #Laravel

Miscellaneous concepts and libraries for Laravel based development

 

 

 

keep reading

Misc Laravel Resources #Laravel

Laravel on GitHub : https://github.com/laravel/laravel

Laravel releases: Latest release is 5.3.16 (released on Oct 2nd)
https://github.com/laravel/laravel/releases

Laravel Development Branches

Master: Should be the production ready version
Develop : Should be the active development version
Stale : Should be the ones – no longer under development and extension

Laravel contributors: https://github.com/laravel/laravel/graphs/contributors
Be one of them. From: http://sitestree.com/?p=6024
Categories:Laravel
Tags:
Post Data:2016-12-22 17:57:24

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Laravel Application Testing #Laravel

<?php

use IlluminateFoundationTestingWithoutMiddleware;
use IlluminateFoundationTestingDatabaseTransactions;

class ExampleTest extends TestCase
{
    /**
     * A basic functional test example.
     *
     * @return void
     */
    public function testBasicExample()
    {
        $this->visit('/')
             ->see('Laravel 5')
             ->dontSee('Rails');
    }
}
--
public function testBasicExample()
{
    $this->visit('/')
         ->click('About Us')
         ->seePageIs('/about-us');
}

--

Also check: Selenium web-drive: http://www.guru99.com/first-webdriver-script.html

From: http://sitestree.com/?p=4687
Categories:Laravel
Tags:
Post Data:2016-12-10 22:16:37

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Laravel Testing Databases #Laravel

public function testDatabase()
{
    // Make call to application...

    $this->seeInDatabase('users', [
        'email' => 'sally@example.com'
    ]);
}

---

<?php

use IlluminateFoundationTestingWithoutMiddleware;
use IlluminateFoundationTestingDatabaseMigrations;
use IlluminateFoundationTestingDatabaseTransactions;

class ExampleTest extends TestCase
{
    use DatabaseMigrations;

    /**
     * A basic functional test example.
     *
     * @return void
     */
    public function testBasicExample()
    {
        $this->visit('/')
             ->see('Laravel 5');
    }
}

 


 

<?php

use IlluminateFoundationTestingWithoutMiddleware;
use IlluminateFoundationTestingDatabaseMigrations;
use IlluminateFoundationTestingDatabaseTransactions;

class ExampleTest extends TestCase
{
    use DatabaseTransactions;

    /**
     * A basic functional test example.
     *
     * @return void
     */
    public function testBasicExample()
    {
        $this->visit('/')
             ->see('Laravel 5');
    }
}

---

$factory->define(AppUser::class, function (FakerGenerator $faker) {
    static $password;

    return [
        'name' => $faker->name,
        'email' => $faker->unique()->safeEmail,
        'password' => $password ?: $password = bcrypt('secret'),
        'remember_token' => str_random(10),
    ];
});
---


Reference: Laravel official documentation

From: http://sitestree.com/?p=4685
Categories:Laravel
Tags:
Post Data:2016-12-10 22:13:28

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Laravel Query Builder, Cheatsheet #Laravel

$users = DB::table(‘users’)->get()
$user = DB::table(‘users’)->where(‘name’, ‘John’)->first();
$name = DB::table(‘users’)->where(‘name’, ‘John’)->pluck(‘name’);
$roles = DB::table(‘roles’)->lists(‘title’);
$roles = DB::table(‘roles’)->lists(‘title’, ‘name’);
$users = DB::table(‘users’)->select(‘name’, ’email’)->get();
$users = DB::table(‘users’)->distinct()->get();
$users = DB::table(‘users’)->select(‘name as user_name’)->get();
$query = DB::table(‘users’)->select(‘name’);
$users = $query->addSelect(‘age’)->get();
$users = DB::table(‘users’)->where(‘votes’, ‘>’, 100)->get();
$users = DB::table(‘users’)->where(‘votes’, ‘>’, 100)->orWhere(‘name’, ‘John’)->get();
$users = DB::table(‘users’)->whereBetween(‘votes’, array(1, 100))->get();
$users = DB::table(‘users’)->whereNotBetween(‘votes’, array(1, 100))->get();
$users = DB::table(‘users’)->whereIn(‘id’, array(1, 2, 3))->get();
$users = DB::table(‘users’)->whereNotIn(‘id’, array(1, 2, 3))->get();
$users = DB::table(‘users’)->whereNull(‘updated_at’)->get();
$users = DB::table(‘users’)->orderBy(‘name’, ‘desc’)->groupBy(‘count’)->having(‘count’, ‘>’, 100)->get();
$users = DB::table(‘users’)->skip(10)->take(5)->get();
DB::table(‘users’)->join(‘contacts’, ‘users.id’, ‘=’, ‘contacts.user_id’)
->join(‘orders’, ‘users.id’, ‘=’, ‘orders.user_id’)
->select(‘users.id’, ‘contacts.phone’, ‘orders.price’)
->get();
DB::table(‘users’)->leftJoin(‘posts’, ‘users.id’, ‘=’, ‘posts.user_id’)->get();
DB::table(‘users’)
->join(‘contacts’, function($join)
{
$join->on(‘users.id’, ‘=’, ‘contacts.user_id’)->orOn(…);
})
->get();

DB::table(‘users’)
->join(‘contacts’, function($join)
{
$join->on(‘users.id’, ‘=’, ‘contacts.user_id’)
->where(‘contacts.user_id’, ‘>’, 5);
})
->get();

select * from users where name = ‘John’ or (votes > 100 and title <> ‘Admin’)
DB::table(‘users’)
->where(‘name’, ‘=’, ‘John’)
->orWhere(function($query)
{
$query->where(‘votes’, ‘>’, 100)
->where(‘title’, ‘<>’, ‘Admin’);
})
->get();

select * from users
where exists (
select 1 from orders where orders.user_id = users.id
)
DB::table(‘users’)
->whereExists(function($query)
{
$query->select(DB::raw(1))
->from(‘orders’)
->whereRaw(‘orders.user_id = users.id’);
})
->get();
$users = DB::table(‘users’)->count();
$price = DB::table(‘orders’)->max(‘price’);
$price = DB::table(‘orders’)->min(‘price’);
$price = DB::table(‘orders’)->avg(‘price’);
$total = DB::table(‘users’)->sum(‘votes’);

$first = DB::table(‘users’)->whereNull(‘first_name’);

$users = DB::table(‘users’)->whereNull(‘last_name’)->union($first)->get();
DB::table(‘users’)->where(‘votes’, ‘>’, 100)->lockForUpdate()->get();
$users = DB::table(‘users’)
->select(DB::raw(‘count(*) as user_count, status’))
->where(‘status’, ‘<>’, 1)
->groupBy(‘status’)
->get();
DB::table(‘users’)->insert(
array(’email’ => ‘john@example.com’, ‘votes’ => 0)
);
$id = DB::table(‘users’)->insertGetId(
array(’email’ => ‘john@example.com’, ‘votes’ => 0)
);

DB::table(‘users’)->insert(array(
array(’email’ => ‘taylor@example.com’, ‘votes’ => 0),
array(’email’ => ‘dayle@example.com’, ‘votes’ => 0),
));
DB::table(‘users’)->insert(array(
array(’email’ => ‘taylor@example.com’, ‘votes’ => 0),
array(’email’ => ‘dayle@example.com’, ‘votes’ => 0),
));

DB::table(‘users’)->increment(‘votes’);

DB::table(‘users’)->increment(‘votes’, 5);

DB::table(‘users’)->decrement(‘votes’);

DB::table(‘users’)->decrement(‘votes’, 5);
DB::table(‘users’)->increment(‘votes’, 1, array(‘name’ => ‘John’));
DB::table(‘users’)->where(‘votes’, ‘<‘, 100)->delete();
DB::table(‘users’)->delete();
DB::table(‘users’)->truncate();

$first = DB::table(‘users’)->whereNull(‘first_name’);

$users = DB::table(‘users’)->whereNull(‘last_name’)->union($first)->get();

DB::table(‘users’)->where(‘votes’, ‘>’, 100)->sharedLock()->get();

DB::table(‘users’)->where(‘votes’, ‘>’, 100)->lockForUpdate()->get();

$users = DB::table(‘users’)->remember(10)->get();

$users = DB::table(‘users’)->cacheTags(array(‘people’, ‘authors’))->remember(10)->get();

Reference: Laravel online Documentation From: http://sitestree.com/?p=4666
Categories:Laravel
Tags:
Post Data:2016-12-07 21:38:15

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Envoyer: Zero Downtime PHP application Deployment #Laravel #and Deployment

Zero Downtime PHP Deployment – Laravel application deployment

Deployments you’ve only dreamed about. Zero downtime. Zero fuss.

https://laracasts.com/series/envoyer/episodes/1

From: http://sitestree.com/?p=10673
Categories:Laravel, and Deployment
Tags:
Post Data:2017-06-30 17:55:28

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Topic 3: Example : Misc Operator Examples #Linux/Unix: Shell Programming – 001

bash-3.2$ cat math.ksh
#!/bin/ksh
# Script name: math.ksh
# This script finds the cube of a number, and the
# quotient and remainder of the number divided by 4.
y=99
(( cube = y * y * y ))
(( quotient = y / 4 ))
(( rmdr = y % 4 ))
print “The cube of $y is $cube.”
print “The quotient of $y divided by 4 is $quotient.”
print “The remainder of $y divided by 4 is $rmdr.”
# Notice the use of parenthesis to
# control the order of evaluating.
(( z = 2 * (quotient * 4 + rmdr) ))
print “Two times $y is $z.”

 

——
bash-3.2$ ./math.ksh
The cube of 99 is 970299.
The quotient of 99 divided by 4 is 24.
The remainder of 99 divided by 4 is 3.
Two times 99 is 198.

From: http://sitestree.com/?p=12236
Categories:Linux/Unix: Shell Programming – 001
Tags:
Post Data:2018-05-08 23:37:30

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Topic 3: Example : Operator #Linux/Unix: Shell Programming – 001

bash-3.2$ cat operator6.sh
#!/bin/ksh
x=15.38
y=15.72
((z = x + y))
echo $z

 

bash-3.2$ ./operator6.sh
30 From: http://sitestree.com/?p=12234
Categories:Linux/Unix: Shell Programming – 001
Tags:
Post Data:2018-05-08 15:32:42

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Topic 3: Example: Simple expr statement in shell scripting #Linux/Unix: Shell Programming – 001

bash-3.2$ cat operator5.sh
#!/bin/ksh
num1=10
num2=20
echo $num1
num2=`expr $num1 + 25`
echo $num2
num3=`expr $num1 + $num2`
echo $num3
num4=`expr $num1 * $num2`
echo $num4
num5=`expr $num2 / $num1`
echo $num5
num6=`expr $num1 % 3`
echo $num6

 

bash-3.2$ ./operator5.sh
10
35
45
350
3
1

From: http://sitestree.com/?p=12232
Categories:Linux/Unix: Shell Programming – 001
Tags:
Post Data:2018-05-07 15:17:44

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Topic 3: Example: Expr statements in Shell Scripts #Linux/Unix: Shell Programming – 001

bash-3.2$ cat operator1.sh operator2.sh operator3.sh
#!/bin/sh
num1=5
echo $num1
num2=$num1+10
echo $num2
#!/bin/sh
num1=5
echo $num1
expr $num1 + 7
expr $num1+7 #space matters for expr
echo $num1

#!/bin/sh
num1=5
expr $num1 * 2
expr “$num1 * 2”
expr $num1 * 2 From: http://sitestree.com/?p=12230
Categories:Linux/Unix: Shell Programming – 001
Tags:
Post Data:2018-05-06 14:40:30

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada