Exemplo n.º 1
0
 public function save()
 {
     $company = new \App\Company();
     $company->nama_company = Input::get('nama_company');
     $company->save();
     return redirect('company');
 }
Exemplo n.º 2
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Requests\CreateCompanyRequest $response)
 {
     //
     $data = $response->all();
     $companies = new \App\Company($data);
     // dd($companies);
     $companies->save();
     return redirect('admin/company');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $user = \Auth::user();
     if ($user->role->name == 'admin' || $user->role->name == 'root') {
         $company = new \App\Company();
         $data = $request->json()->get('data');
         $company->name = $data[0]['company'];
         $company->save();
         return back()->withInput();
     }
 }
Exemplo n.º 4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     foreach (App\Company::all() as $company) {
         $company->touch();
         $company->created_at = $company->updated_at;
         $company->save();
     }
 }
Exemplo n.º 5
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // $this->call(UserTableSeeder::class);
     App\User::unguard();
     App\Company::unguard();
     App\PrimarySkills::unguard();
     App\SecondarySkills::unguard();
     App\Platform::unguard();
     $this->call(CompanyTableSeeder::class);
     $this->call(UserTableSeeder::class);
     $this->call(PrimarySkillsTableSeeder::class);
     $this->call(SecondarySkillsTableSeeder::class);
     $this->call(PlatformsTableSeeder::class);
     App\Platform::reguard();
     App\SecondarySkills::reguard();
     App\PrimarySkills::reguard();
     App\Company::reguard();
     App\User::reguard();
 }
Exemplo n.º 6
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     App\Company::create(array('comName' => 'Test bedrijf', 'comStreet' => 'wegstraat', 'comNumber' => '14', 'comZipCode' => '1234 AB', 'comCity' => 'Lieren', 'comUserId' => 2));
     App\Company::create(array('comName' => 'Bedrijf Twee', 'comStreet' => 'kerkweg', 'comNumber' => '44', 'comZipCode' => '1234 AB', 'comCity' => 'Apeldoorn', 'comUserId' => 3));
 }
Exemplo n.º 7
0
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', ['middleware' => 'auth', 'uses' => 'CompanyController@index']);
Route::model('company', 'Company');
Route::model('customer', 'Customer');
Route::model('driver', 'Driver');
Route::model('truck', 'Truck');
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
Route::bind('company', function ($value, $route) {
    return App\Company::whereId($value)->first();
});
Route::bind('customer', function ($value, $route) {
    return App\Customer::whereId($value)->first();
});
Route::bind('driver', function ($value, $route) {
    return App\Driver::whereId($value)->first();
});
Route::bind('truck', function ($value, $route) {
    return App\Truck::whereId($value)->first();
});
Route::resource('company', 'CompanyController');
Route::resource('customer', 'CustomerController');
Route::resource('driver', 'DriverController');
Route::resource('truck', 'TruckController');
Exemplo n.º 8
0
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    return view('welcome');
});
Route::group(['prefix' => 'api/v0.1'], function () {
    // Make sure the API is working.
    Route::get('/heartbeat', function () {
        return Response::json(["response" => "OK"])->header('Access-Control-Allow-Origin', '*');
    });
    Route::get('/docs', function (Request $request) {
        return view('docs', ['users' => App\User::all(), 'companies' => App\Company::with('user')->get(), 'request' => $request]);
    });
    // User Management Routes
    Route::group(['prefix' => 'user'], function () {
        Route::post('/login', "UserManagementController@loginUser");
        Route::post('/register', "UserManagementController@registerUser");
        Route::group(['middleware' => ['customauth']], function () {
            Route::put('/edit', "UserManagementController@editUser");
            Route::patch('/password', "UserManagementController@changePassword");
            Route::post('/logout', "UserManagementController@logoutUser");
            Route::delete('/deactivate', "UserManagementController@deactivateUser");
            Route::get('/get', "UserManagementController@getUser");
        });
    });
    // Chat Routes
    Route::group(['middleware' => ['customauth'], 'prefix' => 'chat'], function () {
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<?php 
//get company details
$company = App\Company::all()->first();
?>
	<title>@if(isset($company->company_name)) {{ $company->company_name }} @else Company @endif | {{$title}}</title>

	
  	<link href="{{ asset('/css/normalize.css') }}" rel="stylesheet">
  	<link href="{{ asset('/css/bootstrap.css') }}" rel="stylesheet">
	<link href="{{ asset('/css/dashboard.css') }}" rel="stylesheet">
	<link href="{{ asset('/css/font-awesome.min.css') }}" rel="stylesheet">

  	<script src="{{ asset('/js/jquery.js') }}" rel="stylesheet"></script>
	<script src="{{ asset('/js/bootstrap.min.js') }}" rel="stylesheet"></script>
	<script src="{{ asset('/js/masonry.pkgd.min.js') }}" rel="stylesheet"></script>
	<script src="{{ asset('/js/dash.js') }}" rel="stylesheet"></script>


	<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
		<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
		<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
	<![endif]-->
Exemplo n.º 10
0
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', 'WelcomeController@index');
Route::get('dashboard', 'PagesController@dashboard');
Route::get('login', 'PagesController@login');
Route::get('home', function () {
    if (Auth::guest()) {
        return Redirect::to('login');
    } else {
        return view('pages.dashboard')->with('users', App\User::all())->with('task_categories', App\TaskCategory::all())->with('tasks', App\Task::all())->with('companies', App\Company::all())->with('contracts', App\Contract::all())->with('solutions', App\Solution::all())->with('clients', App\Client::all())->with('employees', App\Employee::all());
    }
});
// model routes..
Route::post('tc/store', 'TaskCategoryController@store');
Route::post('tc/edit/{id}', array('uses' => 'TaskCategoryController@edit', 'as' => 'route.edit'));
Route::patch('tc/{id}', array('uses' => 'TaskCategoryController@update', 'as' => 'route.update'));
Route::delete('tc/{id}', array('uses' => 'TaskCategoryController@destroy', 'as' => 'route.destroy'));
Route::post('task/store', 'TaskController@store');
Route::post('task/edit/{id}', array('uses' => 'TaskController@edit', 'as' => 'task.edit'));
Route::post('task/approve/{id}', array('uses' => 'TaskController@approve', 'as' => 'task.approve'));
Route::patch('task/{id}', array('uses' => 'TaskController@update', 'as' => 'task.update'));
Route::delete('task/{id}', array('uses' => 'TaskController@destroy', 'as' => 'task.destroy'));
Route::post('client/store', 'ClientController@store');
Route::post('client/edit/{id}', array('uses' => 'ClientController@edit', 'as' => 'client.edit'));
Route::patch('client/{id}', array('uses' => 'ClientController@update', 'as' => 'client.update'));
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     App\Company::create(['name' => str_random(10), 'email' => str_random(10) . '@gmail.com', 'password' => bcrypt('secret')]);
 }