Skip to content

Instantly share code, notes, and snippets.

View marufmax's full-sized avatar
🎯
Focusing

Maruf Alom marufmax

🎯
Focusing
View GitHub Profile
@marufmax
marufmax / install-laravel.sh
Created May 10, 2017 14:51 — forked from bigbeno37/install-laravel.sh
Install Laravel 5.4, MySQL 5.7, Apache2.4 and PHP7.1 on Ubuntu 16.04
# CREATED BY BEN O'SULLIVAN / BIGBENO37 (GITHUB.COM/BIGBENO37)
# LICENSED UNDER CREATIVE COMMONS 'Attribution 4.0 International' LICENSE
# https://creativecommons.org/licenses/by/4.0/
# FEEL FREE TO USE AND ADAPT THIS SCRIPT IN COMMERCIAL AND NON COMMERICAL PRODUCTS
# AS LONG AS PROPER ACCREDITATION IS GIVEN
# VARIABLES
echo -e "\x1B[01;95mWhat would you like to name your Laravel project?\x1B[0m"
read LARAVEL_PROJECT_NAME
@marufmax
marufmax / ifelse
Created February 28, 2018 06:46
Java Posetive and Negetive number checking using If else elseif
public class JavaBasic {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int num;
System.out.println("Enter Any Number: ");
num = input.nextInt();
@marufmax
marufmax / error.blade.php
Created March 22, 2018 17:17
Laravel Bootstrap Session Success and Error Flash Messages
@if(isset($errors)&&count(errors) > 0)
<div class="alert alert-dismissible alert-danger fade show">
<button type="button" class="close" data-dismiss="alter" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
@foreach($errors->all() as $error)
<li>
<strong>{!! $error !!}</strong>
</li>
@endforeach
@marufmax
marufmax / deleteWithJS.php
Last active March 23, 2018 21:47
Laravel Delete Action with JS
<a class="btn btn-outline-secondary" onclick="
var result = confirm('Are you sure you wish to delete this project?');
if (result) {
event.preventDefault();
document.getElementById('delete-form').submit();
}"
>Delete</a>
<form id="delete-form" action="{{ route('companies.destroy', [$company->id]) }}" method="POST" style="display: none;">
<input type="hidden" name="_method" value="delete">
{{ csrf_field() }}
@marufmax
marufmax / README.md
Created March 23, 2018 07:39 — forked from nammuey/README.md
My simply MySQL Command Line Cheatsheet
@marufmax
marufmax / destroy.php
Created March 23, 2018 21:46
Laravel CRUD
public function destroy(Company $company)
{
$findCompany = Company::find( $company->i);
if ($findCompany->delete()) {
return redirect()->route('companies.index')->with('success','Company Deleted Successfully');
}
return back()->withInput()->with('error','Delectation Error');
}
@marufmax
marufmax / random.java
Last active March 26, 2018 11:38
Android Random Number Guessing Game
package com.example.marufalom.calculator;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import java.util.Random;
@marufmax
marufmax / ProductsTableSeeder.php
Created March 30, 2018 20:49
Products Table Seeder with Faker (Fake Data) - Laravel
<?php
use Illuminate\Database\Seeder;
use App\Product;
use Faker\Factory as Faker;
class ProductsTableSeeder extends Seeder
{
/**
@marufmax
marufmax / _ide_helper_custom.php
Created April 12, 2018 11:14
Laravel PHPStrom IDE Helper PHP File
<?php
namespace {
exit("This file should not be included, only analyzed by your IDE");
}
namespace Illuminate\Support {
/**
* @method Fluent first()
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif