List all diskutil list Mount disk diskutil mount /dev/disk2s1 Umount diskutil unmount /dev/disk2s1
Arkib Catatan
Himpunan catatan, tutorial dan nota lama. Sesetengah teknologi, harga dan amalan mungkin telah berubah.
-
-
There is a lot special functions that helps simplified our code like this Looking for more? Visit here or https://laravel.com/docs/5.3/eloquent-collections.
-
Sentinel::RegisterAndActivate() //Register the $request user and activate if(Sentinel::registerAndActivate($request->All())){ //Search the new registered user $user = User::whereEmail($request->get(’email’))->firstOrFail(); //Bind the user to Activation Table $activation=Activation::create($userSentinel); //Assign A Profile To The New Registered User $userProfile = new Profile(); $userProfile->user_id = $user->id; $userProfile->smoked = $request->smoked; $userProfile->lat = 0.0; $userProfile->lng = 0.0; $user->profile()->save($userProfile); //Find role $role=Sentinel::findRoleBySlug(‘member’)->firstOrFail(); //Attach the user to…
-
This is examples how Laravels handle exceptions. try{ .. .. Business Logic .. .. } catch(ThrottlingException $e){ $delay = $e->getDelay(); return redirect()->response->withErrors(“You are banned for $delay seconds.”); } catch(NotActivatedException $e){ return redirect()->response->withErrors(“You account is not activated.”); } Not to forget at the top of the class use Cartalyst\Sentinel\Checkpoints\ThrottlingException; use Cartalyst\Sentinel\Checkpoints\NotActivatedException;
-
There is time where we need to indentify is this the correct page / route we access before we proceed to the next step. Route @if(action(‘FuntasticController@show’) == Request::url()) {} Name Route @if(Route::is(‘locationCluster’)){} or @if(route(‘namedRoute’) == Request::url()){}
-
In terms of security, it is not wise to use GET method to logout from your applications. To make more secure, use POST method. <li> <a href=”{{ url(‘/logout’) }}” onclick=”event.preventDefault(); document.getElementById(‘logout-form’).submit();”> Logout </a> <form id=”logout-form” action=”{{ url(‘/logout’) }}” method=”POST” style=”display: none;”> {{ csrf_field() }} </form> </li> In your controller public function logout() { if(Sentinel::logout()){ return…
-
Instead of @if(session(‘error’)) <div class=”alert alert-danger”> {{session(‘error’)}} </div> @elseif(session(‘success’)) <div class=”alert alert-success”> {{session(‘success’)}} </div> @endif Do like this @foreach($errors->all() as $error) <p class=”alert alert-danger”>{{ $error }}</p> @endforeach @if(session(‘status’)) <div class=”alert alert-success”> {{ session(‘status’) }} </div> @endif Or <div class=”alert alert-danger”> <ul> @foreach($errors->all() as $error) <li>{{$error}}</li> @endforeach </ul> </div> In controller return redirect()->back()->with(‘status’,’Process is successfully done!’);…
-
Ada banyak package yang dibangunkan oleh komuniti Laravel ni. Kesemua package ini boleh didapati di http://packalyst.com/ yang merupakan direktori yang menyenaraikan semua package yang boleh digunakan untuk projek anda. Paling best, kebanyakannya free. Antara package yang penting adalah Admin Package. Tak payah dah nak buang masa nak develop sendiri. Antara package yang feymes: VOYAGER CRUDBOOSTER LARA…