Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function add()
- {
- $message = null;
- if(Request::isMethod('POST'))
- {
- // add bulk accounts
- $string = Input::get('accounts');
- $accounts = explode("\n", $string);
- foreach($accounts as $account)
- {
- $info = explode(",", $account);
- $act = new Accounts();
- $act->username = $info[0];
- $act->password = $info[1];
- $act->package_id = Input::get('package');
- unset($info[0]);
- unset($info[1]);
- $act->info = implode(" , ", $info);
- $act->save();
- }
- $message = 'accounts added successfully.';
- }
- return View::make('admin/addaccounts')->with('message', $message);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement