This repository is a Application software with PHP7, Laravel, VUEjs and MYSQL, this application contains an application in VUEjs that connects to an API created with Laravel.
Using PHP7, VUEjs 2 and laravel 5.5 preferably.
$ git clone https://github.com/DanielArturoAlejoAlvarez/Uhura.git [NAME APP]
Follow the following steps and you're good to go! Important:
...
Route::get('my-thinkings', 'ThinkController@getThinkings');
Route::post('save-think', 'ThinkController@store');
...
...
public function store(Request $request){
$this->validate($request, [
'desc'=>'required'
]);
Think::create($request->all());
return;
}
...
...
export default {
data() {
return{
thinkings: [],
newThink: '',
}
},
created: function(){
this.getThinkings();
},
methods: {
since: function(d){
return moment(d).fromNow();
},
getThinkings: function(){
var urlThinkings = 'my-thinkings';
axios.get(urlThinkings).then(response=>{
this.thinkings=response.data;
});
},
createThink: function(){
var url = 'save-think';
axios.post(url, {
desc: this.newThink
}).then(response=>{
this.getThinkings();
this.newThink='';
toastr.success('New think saved successfully.');
}).catch(error=>{
toastr.error('ERROR!!');
})
}
}
}
...
...
class Think extends Model
{
protected $fillable = ['desc'];
}
...
Bug reports and pull requests are welcome on GitHub at https://github.com/DanielArturoAlejoAlvarez/Uhura. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.